开发者

Any way to disable tooltip (title attribute) when right click (contextmenu)?

开发者 https://www.devze.com 2023-02-10 19:45 出处:网络
Using jQuery, I would like the tooltip to work on hover, and con开发者_运维百科text menu to work on right click, but not with the tooltip hovering over my contextmenu. Is this possible?What about some

Using jQuery, I would like the tooltip to work on hover, and con开发者_运维百科text menu to work on right click, but not with the tooltip hovering over my contextmenu. Is this possible?


What about something like this?

Basically, blank the title attribute on context menu initialization, and then reset it on context menu disappearing.


I think you will be lucky to override control of the tooltip display away from Internet Explorer;

However, try this:

  1. Set the title attribute to an empty string on hover, storing the value in a custom attribute.
  2. Then draw the tooltip yourself using javascript/dom manipulation.

Right clicking could then vanquish the tooltip.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号