如何即时更改 jQuery mouseoverIntent 插件实例设置?

发布于 2024-12-28 18:19:13 字数 317 浏览 3 评论 0原文

我正在使用 jQuery hideIntent 插件,如下所示:

$('#box').hoverIntent({ over:function_a, out:function_b, interval:0 });

但是我想更改设置 -在 function_a 中飞行此实例,将间隔设置为 500。这可以实现吗?如何实现?

非常感谢您的帮助。

I am using jQuery hoverIntent plugin like this:

$('#box').hoverIntent({ over:function_a, out:function_b, interval:0 });

However I want to change setting on-the-fly of this instance within function_a to set interval to 500. Can this be achieved and how ?

Thank you very much for any help.

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

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

发布评论

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

评论(1

清风疏影 2025-01-04 18:19:13

hrefIntent 插件向分配给它的每个 DOM 元素添加两个自定义属性

,例如:

变为

现在:

  • hoverIntent_t 是轮询间隔计时器,或 mouseOut 计时器。
  • hideIntent_s 存储状态以防止不匹配的函数调用。

所以你可以像这样直接改变#box的内部状态:

$("#box").attr("hoverIntent_t", "500");

The hoverIntent plugin add two custom attributes to every DOM element it's assigned to

For example: <div id="box"> became <div id="box" hoverIntent_t="" hoverIntent_s="">

Now:

  • hoverIntent_t is the polling interval timer, or the mouseOut timer.
  • hoverIntent_s stores the state to prevent unmatched function calls.

So you can directly change the internal state of #box like this:

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