How to disable tooltip in the browser with jQuery?

后端 未结 7 1846
名媛妹妹
名媛妹妹 2020-11-29 06:11

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 conten

相关标签:
7条回答
  • 2020-11-29 06:50
    function hideTips(event) {  
        var saveAlt = $(this).attr('alt');
        var saveTitle = $(this).attr('title');
        if (event.type == 'mouseenter') {
            $(this).attr('title','');
            $(this).attr('alt','');
        } else {
            if (event.type == 'mouseleave'){
                $(this).attr('alt',saveAlt);
                $(this).attr('title',saveTitle);
            }
       }
    }
    
    $(document).ready(function(){
     $("a").live("hover", hideTips);
    });
    

    Hi all. I am using this solution and it works fine in all browsers.

    0 讨论(0)
提交回复
热议问题