如何使用jquery在鼠标离开2个div时触发mouseleave

发布于 2024-08-26 13:55:29 字数 116 浏览 6 评论 0原文

我有 2 个彼此相邻的 div,我希望 mouseleave 在鼠标离开 2 个 div 时触发,而不是在离开其中一个 div 时触发。

我怎样才能使用 jquery 做到这一点?

干杯

i have 2 divs next to each other i want mouseleave to fire when the mouse leaves the 2 divs not when it leaves one of them.

how can i do that using jquery?

Cheers

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

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

发布评论

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

评论(1

流星番茄 2024-09-02 13:55:29

你可以用另一个 div 包围这两个 div 并在其上抓住 mouseleave。

You could surround the two divs with another div and catch the mouseleave on that.

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