如何使用 jQuery QTip 在鼠标悬停超过 1 秒后显示某些内容

发布于 2024-08-09 14:44:29 字数 419 浏览 3 评论 0原文

我想在之后显示 QTIP (http://craigsworks.com/projects/qtip/)我的鼠标悬停在链接上的时间超过 1 秒。这怎么可能?

如果我将鼠标悬停在元素上的时间少于 1 秒,则不会发生任何情况。 我尝试了以下代码,但我的浏览器崩溃了:

$(".Details").bind("mouseover", function() 
{
  t= setTimeout($(this).qtip({ args... }), 1000); });
  $(".Details").bind("mouseout", function() { clearTimeout(t); 
}); 

I want to display a QTIP (http://craigsworks.com/projects/qtip/) after my mouseover is longer then 1 second on a link. how is this possible?

If im with the mouse over the element less then 1 second, nothing should happen.
I have tried the below code, but my browser crashes:

$(".Details").bind("mouseover", function() 
{
  t= setTimeout($(this).qtip({ args... }), 1000); });
  $(".Details").bind("mouseout", function() { clearTimeout(t); 
}); 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

德意的啸 2024-08-16 14:44:29

在鼠标悬停事件中,设置一秒钟的超时。在mouseout事件中,取消超时。在超时功能中,显示您的 qtip。

In the mouseover event, set a timeout for a second. In the mouseout event, cancel the timeout. In the timeout function, display your qtip.

梦一生花开无言 2024-08-16 14:44:29

设置 show.delay 属性qTip 插件。

$(function() {
  $('#myDiv').qtip({
    content: 'My tooltip',
    show: { delay: 1000 }
  });

});

Set the show.delay property on the qTip plugin.

$(function() {
  $('#myDiv').qtip({
    content: 'My tooltip',
    show: { delay: 1000 }
  });

});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文