jQuery 工具提示更改事件问题
我正在使用 jQuery 工具插件,在我的页面上使用工具提示。我想更改工具提示的默认行为,以便代替默认的 "mouseover,mouseout"
我想使用 "dblclick,click"
,如下所示
$("#elemName td[title]").tooltip({
position: "center right",
effect: "fade",
events: {
def: "dblclick,click"
}
});
:然后发生的情况是工具提示像我想要的那样在 onDoubleClick 上打开,但关闭行为不是我定义的,它仍然是鼠标移出。
它不是应该允许关闭单击事件(也许我应该使用模式而不是工具提示来实现我想要的行为)或者我做错了什么?
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, 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,当鼠标移到工具提示上方时,工具提示保持可见,并且在鼠标离开时隐藏。如果您不想在 mouseleave 时关闭工具提示,您可以简单地指定:tooltip: "mouseenter"。这使您可以通过编程方式关闭工具提示。
按以下方式修改 jQuery:
});
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:
});
以下配置对我有用:
The following configuration works for me: