enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

Tooltips on scrollable elements aren't positioned correctly #37

Closed abyx closed 11 years ago

abyx commented 11 years ago

I simply created a few tooltips on elements that are inside a div that is scrollable. The tooltips are positioned according to where the elements are "statically", and not where they are when the tooltip should be displayed. This is when the tooltip is fixed and has the target set as the element (so it won't be positioned relative to the cursor).

It can be shown in this fiddle. Just hover over the yellow lines after scrolling a bit. Is this simply not supported or am I missing something basic in making this work?

Thanks

enyo commented 11 years ago

Hi. Unfortunately Opentips are absolutely positioned, so getting them to work inside scrollable divs is kind of tricky because it would also require Opentip to observe if the element is actually visible, and hide if not. You can however call .position() on the Opentip whenever the div is scrolled to force a reposition of the tooltips.