You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Making tooltip disappear on click outside tooltip Created Oct 15, 2009

This thread is solved

Views: 1083     Replies: 4     Last reply Oct 15, 2009  
You must login first before you can use this feature

Kordonme

Posts: 3

Registered:
Oct 15, 2009

Making tooltip disappear on click outside tooltip

Posted: Oct 15, 2009

Hi!

I was wondering if it was possible to make the tooltip disappear on click OUTSIDE of the tooltip. This would be the expected behavior in my example. Show the tooltip on element click and element disappear on tooltip blur, not the tooltip trigger blur.

Is it possible? If not, how to fill a feature request? ;)

Best regards
Mark

degenerate

Posts: 156

Registered:
Sep 19, 2008

» Making tooltip disappear on click outside tooltip

Posted: Oct 15, 2009

Reply to: Making tooltip disappear on click outside tooltip, from Kordonme
Look into the scripting API.

http://flowplayer.org/tools/tooltip.html#api

You can hide() and show() the tooltips as needed. In your case, you can probably bind a function to blur() on your tooltip element that hides the tooltip.

Kordonme

Posts: 3

Registered:
Oct 15, 2009

» » Making tooltip disappear on click outside tooltip

Posted: Oct 15, 2009

Reply to: » Making tooltip disappear on click outside tooltip, from degenerate
Yeah, this makes sence. Actually, the event fires as planned - BUT, how to avoid the tooltip hide when moving the mouse away from the tooltip? Can i prevent the tip from closing?

Kordonme

Posts: 3

Registered:
Oct 15, 2009

» Making tooltip disappear on click outside tooltip

Posted: Oct 15, 2009

Reply to: Making tooltip disappear on click outside tooltip, from Kordonme
Hey.

Just wanted to let everyone know i ended up doing just like this site does it. It's not in any way pretty! Actually I'm not proud of it. I think it should native in the plugin. Anyways, here it is:

$(document).click(function(e) {
    var el = $(e.target)
    if ($(".newcontact:visible").length && !el.parents(".newcontact").length && !el.is("#newcontact")) {
        $(".newcontact").fadeOut();		
    }		
});

degenerate

Posts: 156

Registered:
Sep 19, 2008

» » Making tooltip disappear on click outside tooltip

Posted: Oct 15, 2009

Reply to: » Making tooltip disappear on click outside tooltip, from Kordonme
If you want to fiddle more you should check this thread:
http://flowplayer.org/tools/forum/30/28069

Looks like onbeforehide might we what you want, and Tero is adding it to a development version which you can download.