Hi eridius,
Eridius wrote:
this is my cluetip code:
$('#trip_builder_popup').cluetip({local: true,
mouseOutClose: true,
sticky: true,
positionBy:
'auto'});
I want the box to appear in the same place every time but it is
placed
based on my mouse, how can i stop this as the demo page works like
i want
it to?
I may have to refactor the code a bit now that I have the positionBy
option in there. Early revisions of the plugin tried to decide for
you when to position the tool tip by the element and when to position
it by the mouse, and I kind of took a sledgehammer approach.
Currently, the following conditions will position it by mouse, no
matter what you do:
- the hovered element has display: block
- the hovered element is a map "area"
- there isn't enough room to the right of the left of the hovered
element to fit the tool tip completely within the viewable area.
I can probably remove the first condition, at least for the
horizontal positioning. Vertical positioning is a little different,
though. If the hovered element has display:block and its height is
fairly large, the tooltip might get positioned in an unexpected place
(because if it's not done by mouse position, it lines the tooltip up
with the top of the hovered element).
Any suggestions are most welcome.
Another thing i am looking for is to be able to change the content
in the
tooltip with ajax while it is displaying. I tried to change the
content and
the content does change in the div i have added to but the tooltip
does
not(i guess it pulls the content from the div a displays it instead of
displaying the actucally div). is there a way to refrest the
tooltip while
it is displaying?
Here is the relevant code for populating the clueTip with local content:
var localContent = $(tipAttribute).html();
$cluetipInner.html(localContent);
So, yes, it grabs the innerHTML of the div and displays it. If there
is a more reasonable or beneficial way of doing this, let me know.
Since I'm already emptying $cluetipInner before I populate it with
the new contents, I suppose I could do it this way:
$cluetipInner.append(tipAttribute);
But I don't think that will solve your problem. If you want to
refresh the tooltip while it is displaying, couldn't you just do so
by using the $('#cluetip-inner') selector and one of jQuery's DOM
insertion methods? Also, if you could show me an example of what
you're trying to do, that would be helpful, since I'm not sure I'm
quite understanding you properly.
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com