2017-01-13 13 views
0

私はツールチップを持つImageButtonを持っています。ボタンをクリックすると、ツールチップは表示されたままになり、ページ上のマウスに固執します。私はボタンがクリックされているが、これを行う方法を見つけることができない、ツールヒントが消えるようにしたい。画像のボタンをクリックするとツールチップが表示されます

アドバイスをいただければ幸いです! マークアップ:

<asp:TemplateField HeaderText="Mark as Read"> 
    <ItemTemplate> 
     <asp:ImageButton ID="img_markAsRead" runat="server" ImageUrl="img/icons/eye.png" CssClass="tooltip" Width="20" ToolTip="Mark this Notification as Read" CommandName="Edit" CommandArgument='<%# Eval("notification_id")%>'/> 
    </ItemTemplate> 
</asp:TemplateField> 

CSS:背後

.ui-tooltip { 
    padding: 8px; 
    position: absolute; 
    z-index: 9999; 
    max-width: 300px; 
    -webkit-box-shadow: 0 0 5px #aaa; 
    box-shadow: 0 0 5px #aaa; 
} 

は、コード:あなたのjQueryのタグとクラス名が「UIであるという事実に基づいて

protected void grdv_RowEditing(object sender, GridViewEditEventArgs e) 
{ 
    GridViewRow theRow = grdv_notifications.Rows[e.NewEditIndex]; 
    ImageButton theButton = (ImageButton)theRow.FindControl("img_markAsRead"); 
    string notificationNo = theButton.CommandArgument; 

    #region the clever sql statement to do the updates 

    #endregion 

    //reload the gridview 
    loadGridview(); 

    //set the notification number  
    MasterPage master = (MasterPage)this.Master; 
    master.updateNotificationCount(grdv_notifications.Rows.Count); 
} 

答えて

0

私の脳を痛めつけた後、答えは簡単でした。 ImageButtonをクリックした後にページをリロードするResponse.Redirect("notifications.aspx");

を追加

は、ページを再読み込みし、ツールチップをクリア。 シンプルだが効果的!

0

-tooltip "、私はあなたがjQuerを使用していると推測していますy UIツールチップ。あなたはそれを設定する必要がありますので、その場合には、オプションのいずれかを使用して、初期化あなたがに設定することができ、「トラック」、偽です...

$(document).tooltip({ 
    track: false 
}); 

これは、しかし、デフォルトではする必要があります〜

+0

ありがとうございますが、これは機能しませんでした。このコードを追加した後、画像をクリックしてもツールチップが表示されます。 – akb29

+0

私たちが見ることのできるデモはありますか? –

+0

申し訳ありません私はこのすべてで初心者です - デモを見せるにはどうすればいいですか? – akb29

関連する問題