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/
精彩评论