久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何使用 jQuery 在瀏覽器中禁用工具提示?

How to disable tooltip in the browser with jQuery?(如何使用 jQuery 在瀏覽器中禁用工具提示?)
本文介紹了如何使用 jQuery 在瀏覽器中禁用工具提示?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

有沒有辦法在將鼠標懸停在填充了標題"屬性的元素上時禁用瀏覽器工具提示?請注意,我不想刪除標題內(nèi)容.這是請求的代碼:

Is there a way to disable browser tooltip from displaying when hovering over elements that have attribute 'title' populated? Note that I don't want to remove title content. Here is the code are requested:

  $(document).ready(function() {
     $('a.clickableSticky').cluetip({
         splitTitle: '|',
         showTitle: false,
         titleAttribute: 'description',
         activation: 'click',
         sticky: true,
         arrows: true,
         closePosition: 'title'
     });
 });

在 asp.net 中

and in asp.net

  <ItemTemplate>
     <a class="clickableSticky" href="#"
     title=' <%#((Limit)Container.DataItem).Tip %>'>
     <img src="..App_Themesdefaultimagesiconsinformation.png"/>
     </a>

 </ItemTemplate>

推薦答案

您可以在頁面加載時刪除 title 屬性.

You could remove the title attribute on page load.

$(document).ready(function() {
    $('[title]').removeAttr('title');
});

如果以后需要用到標題,可以將其存儲在元素的jQuery data()中.

If you need to use the title later, you can store it in the element's jQuery data().

$(document).ready(function() {
    $('[title]').each(function() {
        $this = $(this);
        $.data(this, 'title', $this.attr('title'));
        $this.removeAttr('title');
    });
});

另一種選擇是將 title 屬性的名稱更改為 aTitle,或者瀏覽器會忽略的其他名稱,然后更新任何 JavaScript 以讀取新屬性名稱而不是 title.

Another option is to change the name of the title attribute to aTitle, or something else that the browser would ignore, and then update any JavaScript to read the new attribute name instead of title.

更新:

您可以使用的一個有趣的想法是在將鼠標懸停在元素上時懶惰地"刪除標題.當用戶將鼠標懸停在元素上時,您可以將標題值放回去.

An interesting idea you could use is to "lazily" remove the title when hovering over an element. When the user hovers off the element, you can then put the title value back.

這并不像應(yīng)有的那么簡單,因為如果您將 title 屬性設(shè)置為 null 或刪除 title 屬性,IE 不會正確刪除懸停事件上的工具提示.但是,如果您在懸停時將工具提示設(shè)置為空字符串 (""),它將從包括 Internet Explorer 在內(nèi)的所有瀏覽器中刪除工具提示.

This isn't as straightforward as it should be because IE doesn't correctly remove the tooltip on the hover event if you set the title attribute to null or remove the title attribute. However, if you set the tooltip to an empty string ("") on hover, it will remove the tooltip from all browsers including Internet Explorer.

您可以使用我上面提到的方法將title屬性存儲在jQuery的data(...)方法中,然后將其放回mouseout.

You can use the method I mentioned above to store the title attribute in jQuery's data(...) method and then put it back on mouseout.

$(document).ready(function() {
    $('[title]').mouseover(function () {
        $this = $(this);
        $this.data('title', $this.attr('title'));
        // Using null here wouldn't work in IE, but empty string will work just fine.
        $this.attr('title', '');
    }).mouseout(function () {
        $this = $(this);
        $this.attr('title', $this.data('title'));
    });
});

這篇關(guān)于如何使用 jQuery 在瀏覽器中禁用工具提示?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

jQuery/JavaScript Library for avatar creation?(用于創(chuàng)建頭像的 jQuery/JavaScript 庫?)
How to do following mask input problem?(如何做以下掩碼輸入問題?)
Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 設(shè)置值/標簽的問題)
how to unit-test private methods in jquery plugins?(如何對 jquery 插件中的私有方法進行單元測試?)
stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 為垂直滾動網(wǎng)站配置偏移量/對齊元素?)
jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽輸入插件.當文本框獲得焦點時選擇所有內(nèi)容)
主站蜘蛛池模板: 午夜小电影 | 99热播精品 | 午夜精品久久久久久久久久久久久 | 精品成人免费一区二区在线播放 | 成年人国产在线观看 | 亚洲精品日韩一区二区电影 | 综合色婷婷 | 成年视频在线观看福利资源 | 国产成人高清 | 精品国产一区二区三区久久影院 | 亚洲国产精品一区二区三区 | 精品国产三级 | 日韩欧美在线视频 | 秋霞电影院午夜伦 | 天堂成人国产精品一区 | 精品视频一区二区 | 亚洲精品二区 | www.97zyz.com| 视频三区| 国产日韩欧美一区二区 | 久久成人午夜 | 日本一区二区三区四区 | 美女黄网站视频免费 | 国产视频中文字幕在线观看 | 国产欧美精品区一区二区三区 | 久久精品小视频 | 日韩中文字幕2019 | 一区二区三区国产精品 | 一区二区三区免费在线观看 | 国产片一区二区三区 | www.日韩| 亚洲精品一| 久久久久久一区 | 久久久久久亚洲 | 黄网站涩免费蜜桃网站 | 一区二区福利视频 | 天天操操| 日韩一二区 | www.亚洲成人网 | 色综合天天天天做夜夜夜夜做 | 久久精品国产亚洲夜色av网站 |