单击链接后未检测到 jQuery 工具工具提示悬停
使用 jQuery 工具中的工具提示插件,我使用以下代码成功生成了工具提示。
$(".link_prijskaart").tooltip({
tip: "#tooltip_prijskaart",
position: "bottom center",
delay: 1200,
events: {
def: 'click,mouseout',
tooltip: 'mouseenter,mouseleave'
},
offset: [0, 90]
});
工具提示本身是一个简单的 HTML,其中包含锚链接,这些链接链接到 PDF 文件。单击后,PDF 将被传输并下载。在此过程之后,工具提示不再检测到悬停。单击目标时,工具提示会打开,但离开目标时会关闭工具提示;工具提示悬停事件似乎没有触发(在 Firefox 3.6 和 IE8 中测试)。
有谁知道为什么单击链接后工具提示中定义的 mouseenter
和 mouseleave
事件不再注册?
Using the tooltip plugin from the jQuery Tools I successfully generate a tooltip with the following code.
$(".link_prijskaart").tooltip({
tip: "#tooltip_prijskaart",
position: "bottom center",
delay: 1200,
events: {
def: 'click,mouseout',
tooltip: 'mouseenter,mouseleave'
},
offset: [0, 90]
});
The tooltip itself is a simple HTML with anchor links in it, these links link to PDF files. When clicked, the PDF gets streamed and downloaded. After this process, the tooltip does not detect an hover anymore. When the target is clicked the tooltip opens, but the leaving the target closes the tooltip; the tooltip hover event does not seem to trigger (tested in Firefox 3.6 and IE8).
Does anyone have an idea why after clicking in a link the tooltip the mouseenter
and mouseleave
events as defined do not register anymore?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然你的事件被破坏了。也许它们附加到已删除并重新创建的 HTML 标记上。您可以通过 AJAX 下载文件,因此您的 Javascript 事件不会中断,并且即使之后也会成功触发。
Apparently your events are destroyed. Maybe they were attached to HTML tags that were deleted and recreated. Instead of adding the events inside a parameter, you could download the file via AJAX, so your Javascript events will not break and will trigger successfully even afterwards.