Floatbox and Tooltip Together

Page: 1

Author Post
Member
Registered: Jan 2012
Posts: 98
Is there any way of putting a floatbox and an enhanced tooltip on the same element, but with different formatting? I want boxColor to be white for the floatbox (a slideshow) but blue in the tooltip.

Thanks
Administrator
Registered: Aug 2008
Posts: 3382
Yes, no problem. Assign the floatbox class to get floatbox behaviour and the fbTooltip class to get tooltip behaviour. (Multiple classes can be separated by a space, as in class="floatbox fbTooltip".)

The floatbox will get its options from the data-fb-options attribute while the tooltip will get its options from the data-fb-tooltip attribute, so there's no conflict in assigning different options to the different components.
Member
Registered: Jan 2012
Posts: 98
Thanks, Admin. I had hoped to do the formating with classes, to save the cumbersome stuff attached to each element. I imagine that's not possible though.
Administrator
Registered: Aug 2008
Posts: 3382
You can assign options through different class names by using the className option instead of the element's class attribute.

For example:
<a href="abc.html" class="floatbox fbTooltip"
data-fb-options="className:alt"
data-fb-tooltip="source:#ttip1 className:whatever attachToHost:true"
>click me</a>

When testing this to make sure I'm not handing out false information, I discovered that you need to set attachToHost:true for the tooltip to make the handling of clicks on the host element coherent for the user. The attachToHost option could of course be assigned through the presence of the "whatever" class in the above example.
Member
Registered: Jan 2012
Posts: 98
That's much better for when the data-fb-xxxx gets long and complex. Thanks.

Page: 1