fb.end close all windows and/or disable tooltips on mobile devices

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 56
I have a tooltip on a thumbnail image. When you click the thumbnail image with the tooltip it opens a Youtube video in a Floatbox window that overlays the host page.

On mobile devices, when I close the Floatbox window down that hosts the video, the underlying tooltip remains visible. I would like it closed.

The old fb.end function used to close all open Floatbox windows. I did not see that in the documentation anymore, or an option to close ALL open floatbox windows easily.

Or, is there an option to disable tooltips entirely on mobile devices but keep them for desktops? Actually, this is my preferred option.
The latter can probably be done with CSS, but that would be a pretty complicated page and problematic if you had a decent amount of
Tooltips on a page. Tooltips on href links can be confusing on mobile devices and are more intuitive and less intrusive with mouses on desktops.
Administrator
Registered: Aug 2008
Posts: 3382
fb.end( true ) has always closed all open floatboxes and is documented in the API Reference.

You're right. There's a problem on touch devices when combining fbTooltip and floatbox behaviours on a link. They are both rigged up to fire on a touch tap - the tooltips so that touchy people with no mouseover get to see them too.

When a standard floatbox starts, it first looks around for any tooltips or fbContext boxes and closes any it finds. This doesn't help when the tooltip and the floatbox are starting from the same event because the tooltip does not yet exist.

After much deliberation and consultation with the council of elders, I think future Floatbox will just ignore tooltip touches on <a> and <area> elements. Those elements already have behaviours associated with touch taps and the tooltips should just stay out of their way.

The council is failing to come up with a simple workaround for version 6.0.3. I suppose you could put an afterBoxStart callback in the floatbox options to end the tooltip if it's there. Let's say you set instanceName:tt in the tooltip options. Then in the floatbox options, afterBoxStart:`fb.getInstance( 'tt' ).end();`. If the tooltip is not there, you'll get an error message in your console logs, but that's harmless. Avoid it with `if ( fb.getInstance( 'tt' ) ) fb.getInstance( 'tt' ).end();` if you like.

Page: 1