Craga89/qTip2 — Issue #270: Allow style.solo to allow closing only tooltips with the same class
Author: dswitzer
Created: 2011-11-04 15:56:10+00:00
State: open

I have a use case where I want to use the style.solo to close only related tooltips (those that have the same class.) Unfortunately this does not seem to be currently possible. While the style.solo allows for a jQuery object, it's expected to a parent element of where the tooltips might exist. In my use case, this won't work for me.

I've got two main types of tooltips I'm implementing: (1) contextual help (which appears when you're working on a field) and (2) static tooltips that always stay on screen until some action is taken. The tooltips are styled differently, using different classes.

The problem is I want to use style.solo to make sure that only one contextual help tooltip is ever visual, but I never want it to affect the static tooltips. The currently implementation of style.solo doesn't allow this behavior.

What I'd like to be able to do is define a way to specify the style.solo to only close sibling tooltips (those that share a similar base class.)

Idealistically, I could just say something like:

style.solo = ".ui-tooltip-plain";

However, I think that might be confusing since passing a jQuery() object would be expecting a parent object where the tooltips live and passing a string would indicating sibling tooltips to hide.

The only way I've found to work around this behavior is to just change my hide() effect to immediately hide the element. However, I prefer the behavior of solo since it will immediately hide if there's another tooltip that's being shown, or it will fade out slowly if not.