You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is an event before the data is rendered and after it is displayed to the user. It would be nice if there was an event that was triggered after render but before user display. We often want to fiddle with the placement of certain items before showing them to the user.
You had me up until here. What exactly are you trying to do that requires the tooltip content to be visible?
Without knowing the specifics of your situation, generally, if you run into such a situation it would be best to create/modify your elements outside of the document via DOM document fragments or jQuery detached elements. Then you can clone or move the fully prepared elements to the tooltip element via the powertipjq data attribute or just filling the #powertip div manually during the powerTipPreRender event.
If you don't call show beforehand, then the width and the height of the powertip DOM element won't be set properly in the powerTipPreOpen command. This isn't a problem for simple powertips, but in my case, there are many DOM elements in the powertip that have to be neatly stacked and it requires accurate sizing.
To see an example, go here and hover over Oracle in the party names.
Wow, that is probably the largest tooltip that I have ever seen (imho too large). What are you trying to do here that requires or would be made easier by having a pre-open event?
All of the white little boxes are the attorneys in the case. If I add the boxes naively they look really bad because there are oddly spaced gaps between the attorney names. To fix that, I use the masonry library which stacks them nicely. I want masonry to run before I start fading in the tooltip. However, in order for masonry to run properly, the elements need to be fully rendered. Accordingly, I show the DOM element very quickly, run masonry, and then hide it.
I've never used masonry before. But have you tried running it on an unattached jQuery object? You might be able to generate your tooltip content in a new jQuery object, run masonry on it, then attach that object to the powertipjq data attribute on page load.
Example:
// domready$(function(){varattorneyList=$('<div><div class="attorney">Foo Bar, Esq.</div></div>');attorneyList.masonry(masonryOptions);$('#plaintiff').data('powertipjq',attorneyList);$('#plaintiff').powerTip();});
Activity
speedplane commentedon Jul 28, 2013
It's an easy fix too, just add two lines in
showTip
:speedplane commentedon Jul 28, 2013
Actually, I need a slight change to the above, because the elements need to be visible to have their attributes set:
stevenbenner commentedon Aug 4, 2013
You had me up until here. What exactly are you trying to do that requires the tooltip content to be visible?
Without knowing the specifics of your situation, generally, if you run into such a situation it would be best to create/modify your elements outside of the document via DOM document fragments or jQuery detached elements. Then you can clone or move the fully prepared elements to the tooltip element via the
powertipjq
data attribute or just filling the#powertip
div manually during thepowerTipPreRender
event.speedplane commentedon Aug 4, 2013
If you don't call
show
beforehand, then the width and the height of the powertip DOM element won't be set properly in thepowerTipPreOpen
command. This isn't a problem for simple powertips, but in my case, there are many DOM elements in the powertip that have to be neatly stacked and it requires accurate sizing.To see an example, go here and hover over Oracle in the party names.
stevenbenner commentedon Aug 4, 2013
Wow, that is probably the largest tooltip that I have ever seen (imho too large). What are you trying to do here that requires or would be made easier by having a pre-open event?
speedplane commentedon Aug 5, 2013
All of the white little boxes are the attorneys in the case. If I add the boxes naively they look really bad because there are oddly spaced gaps between the attorney names. To fix that, I use the masonry library which stacks them nicely. I want masonry to run before I start fading in the tooltip. However, in order for masonry to run properly, the elements need to be fully rendered. Accordingly, I
show
the DOM element very quickly, run masonry, and then hide it.stevenbenner commentedon Aug 5, 2013
I've never used masonry before. But have you tried running it on an unattached jQuery object? You might be able to generate your tooltip content in a new jQuery object, run masonry on it, then attach that object to the
powertipjq
data attribute on page load.Example: