开发者

jQuery tooltip when hovering text

开发者 https://www.devze.com 2023-04-09 17:20 出处:网络
I currently have a custom tooltip which appears when a user hovers over text, and disappears when the cursor goes elsewhere. However, because of the spaces between text, the tooltip disappears and rea

I currently have a custom tooltip which appears when a user hovers over text, and disappears when the cursor goes elsewhere. However, because of the spaces between text, the tooltip disappears and reappears in a very jittery fashion.

What behavior should I keep in mind to avoid this? It seems that the only way to have hover() activate on a block of text is to have it when the cursor goes over the actual character (and hides when it reaches a gap).

EDIT: Solved, onmousee开发者_如何学Cnter() and onmousemove() were able to do the trick. Unfortunately this is just a drawback of hover()


Try wrapping the text in a span and attach the hover to the span instead.


Could you add a delay on the hover event to make sure that someone wants to hover?

http://api.jquery.com/delay/

0

精彩评论

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