I'm trying to create an effect similar to a tooltip with jQuery.
I'm reusing the same <div>
element (id="tooltip"
) to display the tooltip. Therefore, I need to constantly move this <div>
element every time the user moves the cursor over an element which should display a tooltip. When I use the offset()
property, it works fine the first time but then if I move the mouse repeatedly from one icon to the other, the tooltip starts to jump to different locations.
You can try it out here:
Try moving the mouse from one icon to the other repeatedly, you'll notice that the tooltip jumps around incorrectly. It should always appear immediately to the right of the icon which is hovered over.