On Nov 22, 2007, at 8:24 AM, PJ wrote:
Hello
I'm pretty sure I am missing atrick here - but just in case...
I have the following collection of images/buttons that display a
sticky clueTip when clicked:
$('a.warn').cluetip({
activation: 'click',
width: 180,
'sticky': true,
cluetipClass: 'warning',
dropShadow: true,
'closePosition': 'title',
closeText: 'close',
arrows: true
});
Currently, with a "tip A" open, I have to close "tip A" before I open
another tip ("tip B") - clicking on the "tip B" launcher when "tip A"
is open does nothing. I would like it so that, if I have "tip A" open
already, then when i click to open "tip B" "tip A" closes itself.
I hope that makes sense? Can clueTip cope with this or do I need to do
something extra myself?
Many Thanks
Hi PJ,
You're not missing anything. What you've described is a limitation of
the plugin as it's currently implemented. I'm not sure how to go about
making it work the way you would like it, but I'll give it some more
thought. The problem is that, currently, if you have "activation:
click," the script tries to toggle the tooltip's visibility. When the
tooltip is visible, it hides it; when it's hidden, it shows it. But,
as you've pointed out, this becomes a problem when you click one link
to show a tooltip and then immediately click another. It'll try to
close it. Clicking again will show it with the new contents. I guess
what I have to do (I'm thinking out loud now) is remember the actual
element that gets clicked each time and then only hide the tooltip if
the same element is clicked the next time. If something else is
clicked, carry on as if the tooltip were hidden (reposition it and
dump in the new contents). Again, I'll have to dig through the code
and try to figure out how best to do this. But if anyone has a quick
idea, feel free to jump in. :-)
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com