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 that automatically reposition with their elements #54

Closed nathan-alden-sr closed 11 years ago

nathan-alden-sr commented 11 years ago

This is actually two feature requests, but I figured since they were related I'd list them here.

I have a tooltip that is associated with a form element. The thing is, the form element is centered in the browser. That means when the user resizes the browser, the tooltip doesn't move. I solved this by doing the following:

$(window).resize(function () { $(".opentip-container").reposition(); });

It would be nice if this could be built into the library since I think it's a pretty common scenario.

Also, when using reposition() I noticed that the tooltip lag-slides into place. I want it to remain fixed with the element as the element moves in the window.

nathan-alden-sr commented 11 years ago

Argh! I just realized I was missing opentip.css. The moment I included it the laggy transitions disappeared! I still have to include my resize() call to get the tips to maintain their positions, though.

nathan-alden-sr commented 11 years ago

Opentip appears to work just as I expect it to after some tweaking. Nice job!

enyo commented 11 years ago

Great!