How to stop title attribute from displaying tooltip temporarily?

I've got a popup div showing on rightclick (I know this breaks expected functionality but Google Docs does it so why not?) However the element I'm showing my popup on has a "title" attribute set which appears over the top of my div. I still want the tooltip to work but not when the popup is there.

What's the best way to stop the tooltip showing while the popup is open/openning?

Edit: I am using jQuery


使用jquery,你可以绑定悬停功能,也可以将title属性设置为空onmouseover,然后在鼠标移出时将其重置。

$("element#id").hover(
 function() {
  $(this).attr("title","");
  $("div#popout").show();
 },
 function() {
  $("div#popout").hide();
  $(this).attr("title",originalTitle);
 }
);

下面是通过使用data进行价值存储和prop价值分配如何完成的另一个例子

$('[title]').on({
    mouseenter : function()
    {
        $(this).data('title', this.title).prop('title', '');
    },
    mouseleave: function()
    {
        $(this).prop('title', $(this).data('title'));
    }
});

I think setting to blank space and when the popup closes, setting again the proper text. I think this is the easiest way to stop it.

链接地址: http://www.djcxy.com/p/80902.html

上一篇: jQuery的用户界面对话框:可以创建关闭列表元素?

下一篇: 如何暂停显示工具提示的标题属性?