jQuery tools tooltip change events issue
I'm using the jQuery tools plugin, to use tooltips on my page. I want to change the default behaviour of the tooltip, so that instead of the default "mouseover,mouseout"
I want to use "dblclick,click"
, like this:
$("#elemName td[title]").tooltip({
position: "center right",
effect: "fade",
events: {
def: "dblclick,click"
}
});
What happens then is that the tooltip opens on onDoubleClick like I want开发者_JS百科, but the close behaviour isn't what I defined, it's still the mouseout.
Isn't it supposed to allow closing on the click event (maybe I should be using a modal instead of a tooltip to have the behaviour that I want) or I'm doing something wrong?
By default the tooltip stays visible when the mouse is moved over it and it is hidden upon mouseleave. If you don't want to close the tooltip upon mouseleave, you can simply specify: tooltip: "mouseenter". This gives you the possibility of closing the tooltip programmatically.
Modify the jQuery in the following way:
$("#elemName td[title]").tooltip({
position: "center right",
effect: "fade",
events: {
def: "dblclick,click",
tooltip: "mouseenter"
}
});
The following configuration works for me:
$("#elemName td[title]").tooltip({
position: "center right",
effect: "fade",
events: {
def: "dblclick,click",
tooltip: "mouseenter,click"
}
});
精彩评论