Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive Results #114

Open
softwaretech opened this issue Apr 29, 2014 · 2 comments
Open

Responsive Results #114

softwaretech opened this issue Apr 29, 2014 · 2 comments
Labels
Feature Software improvements that involve implementing new features.

Comments

@softwaretech
Copy link

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.

@stevenbenner
Copy link
Owner

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.

@softwaretech
Copy link
Author

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//issues/114#issuecomment-41753737
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Software improvements that involve implementing new features.
Projects
None yet
Development

No branches or pull requests

2 participants