2017-01-13 57 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; 
} 

後面的代碼:

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

收拾我的大腦後,答案很簡單。

添加Response.Redirect("notifications.aspx");

到點擊的ImageButton後重新加載頁面重新加載頁面並清除了提示。 簡單但有效!

0

根據您的jQuery標籤,事實上,類名是「UI -tooltip「,我猜你正在使用jQuer y UI工具提示。在這種情況下,其中的一個選項是「跟蹤」,您可以設置,當你初始化 ...

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

這應該是默認的雖然,所以你必須將它設置到true

+0

謝謝,但這沒有奏效。添加此代碼後,點擊圖片後,工具提示仍然可見。 – akb29

+0

你有一個我們可以看看的演示? –

+0

對不起,我是一個新手 - 演示演示的最佳方式是什麼? – akb29

相關問題