jquery-powertip
jquery-powertip copied to clipboard
Responsive Results
This plugin is really cool. One issue I've come across is the growth of items in a page. For example:
Let's suppose you had 50 elements on a page vertically. Of those 50 suppose 40 of them are hidden with a jquery hide method. Based on what you select from the 10 elements showing, the other 40 items, little by little, start "showing"/"fading in". The body/page length has now changed.
From using this plugin, it doesn't seem, yet, that the tooltip popup positions adjust for the changing length of the body.
I look forward to upcoming changes.
Unfortunately PowerTip doesn't handle this scenario on it's own. Since tooltips are absolutely positioned on the document (based off the document dimensions when the tooltip was opened) the tooltip elements will remain in a fixed position within the document.
The current workaround is to call the reposition() API method to ask PowerTip to reposition the tooltip when you have made a change that will cause the element with a tooltip to change it's position within the document.
For example:
$(someElements).hide(function() {
$.powerTip.reposition(elementWithTooltip);
});
Currently the reposition() API method requires you to specify the element that you want to update, this may be a problem for your use case. It would be possible to change the reposition() method to make that parameter optional, and make it update the position for whatever tooltip happens to be open at the time it's called (if any).
Another possible way to handle this would be with a MutationObserver, and have PowerTip run the reposition() function anytime an element has it's style, class, or id attribute modified. Unfortunately this is still bleeding-edge tech and has very limited browser support.
I'll think about this one. Right now improving the reposition() API method makes the most sense to me, but it will require you to invoke it whenever you make a change to the document.
I appreciate your feedback.
Thanks!
Thanks,
~Mike Holman~
On Tue, Apr 29, 2014 at 8:08 PM, Steven Benner [email protected]:
Unfortunately PowerTip doesn't handle this scenario on it's own. Since tooltips are absolutely positioned on the document (based off the document dimensions when the tooltip was opened) the tooltip elements will remain in a fixed position within the document.
The current workaround is to call the reposition() APIhttps://stevenbenner.github.io/jquery-powertip/#apimethod to ask PowerTip to reposition the tooltip when you have made a change that will cause the element with a tooltip to change it's position within the document.
For example:
$(someElements).hide(function() { $.powerTip.reposition(elementWithTooltip);});
Currently the reposition() API method requires you to specify the element that you want to update, this may be a problem for your use case. It would be possible to change the reposition() method to make that parameter optional, and make it update the position for whatever tooltip happens to be open at the time it's called (if any).
Another possible way to handle this would be with a MutationObserverhttps://developer.mozilla.org/en-US/docs/Web/API/MutationObserver, and have PowerTip run the reposition() function anytime an element has it's style, class, or id attribute modified. Unfortunately this is still bleeding-edge tech and have very limited browser support.
I'll think about this one. Right now improving the reposition() API method makes the most sense to me, but it will require you to invoke it whenever you make a change to the document.
— Reply to this email directly or view it on GitHubhttps://github.com/stevenbenner/jquery-powertip/issues/114#issuecomment-41753737 .