问题标签 [mouseout]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
12977 浏览

javascript - Jquery - 延迟 mouseout 事件

mouseout有没有办法让 jQuery 在触发事件之前等待一段时间?

目前它触发得太早了,我宁愿等待 500 毫秒,然后再评估鼠标。我在下面使用的代码示例。

有没有 jQuery 方法可以做到这一点,还是我必须自己做?

0 投票
6 回答
1439 浏览

html - 里面的孩子触发mouseout。如何防止这种情况?

0 投票
2 回答
2040 浏览

javascript - 在ie/ff上退出浏览器时clientX和clientY的区别

我刚刚遇到了clientX和clientY的一个小问题。

我放了一个小事件来检测鼠标是否离开窗口并知道它在哪里退出。麻烦来了,它在 Firefox 上运行良好,但在 IE 中只发送 -1 作为答案。有人知道是否有办法在不使用框架的情况下轻松解决该问题?

一些代码来重现它:

如果我从窗口左侧退出,结果是:

e.clientY:302 e.clientX:-130 在火狐上

e.clientY:-1 e.clientX:-1 在即。

提前致谢。

0 投票
4 回答
6496 浏览

jquery - 带有鼠标悬停/鼠标悬停的 jQuery 手风琴导航

我正在尝试创建具有以下属性的手风琴导航菜单:

将鼠标悬停在父 LI 上,其子菜单会向下滑动。如果您将鼠标向下悬停在子菜单上,它会按照您的预期保持打开状态。

如果您将光标从父链接或子菜单上移开,子菜单会再次向上滑动。

我以为我快要接近了——我可以让子菜单滑下,但是当我将鼠标悬停在它上面时,我不得不将鼠标悬停在父 LI 上,从而触发了上滑。我只是不知道如何让它做我需要的!

这是我的脚本:

这是我的 HTML 标记:

真的很感激任何帮助,拜托!

0 投票
3 回答
7859 浏览

jquery - 与 jQuery mouseout 事件混淆

我的 HTML:

当我使用 jQuery

我想知道为什么当我的鼠标进入孩子div时功能会触发。我还在 parent 里面div。我希望该mouseout功能仅在我离开父母时才触发,而div不是在我在任何孩子身上时触发div

http://jsbin.com/esiju/ << 例子

干杯

0 投票
2 回答
6731 浏览

jquery - jQuery动画鼠标悬停/鼠标悬停保持下拉菜单可见

我正在尝试使用动画制作一个基本的下拉菜单,并且遇到了我似乎无法弄清楚如何在鼠标离开之前保持下拉部分打开的问题。有没有一种简单的方法可以告诉它保持开放?我知道我对 .clickme mouseout 功能的看法是完全错误的,因为它会相应地卸载菜单。

如果有人可以在这种特定情况下提供帮助,我将非常感激。

});

0 投票
3 回答
20771 浏览

jquery - jQuery:悬停时显示和隐藏子div

我有一套物品。每个项目都有两个图像和一些文本。对于图像,我创建了一个父 div,它有一个溢出:隐藏的 CSS 值。我想实现鼠标悬停效果。一旦您将鼠标悬停在图像上,我想隐藏当前 div 并显示第二个 div。这是一个小片段:

我创建了一个小的 jQuery 片段:

现在的问题不仅是当前悬停的孩子被隐藏了。相反,所有其他现有的孩子也被隐藏了。我需要像“this”或“current”这样的东西,但我不知道哪个 jQuery 函数是正确的。任何的想法?

谢谢, BJ

0 投票
2 回答
1347 浏览

javascript - 鼠标悬停 - 鼠标移出 - Javascript

我正在尝试做的事情:

当用户将鼠标悬停在图像上时,右上角应出现一个小 x(图像)。如果用户点击这个小 x,图像应该被删除,当用户鼠标移出时,小 x 应该消失。我尝试了几件事:

html结构是一个带有li和一个图像的ul

Javascript:

这不起作用的原因:当用户将鼠标悬停在小图像上时,会触发鼠标悬停。

我也试过:

也试过这个:

这给出了相同的效果,它仍然在闪烁

有没有人有另一个想法如何做到这一点(不需要特定的代码,概念也很受欢迎;))?

0 投票
2 回答
821 浏览

jquery - jQuery and executing code until mouseout is called

Good day all, I am tasked with building a slider for our site. Here is my goal:

I need to move "slider" left 30px at a time when a button is hovered over, and right 30px when another button is hovered over.

My problem is that there doesn't seem to be a reliable method for telling the code that the mouse hasn't left the are in question, unless there is something I did not think about or read yet. In other words, when the mouse is OVER the a button, the code to move "slider" left is executed until the mouseout is called. I'm not really sure how to do this.

The only way I can think of is to look at the offsetTop and offsetLeft and offsetTop DOM properties and compare them to the mouse position, than run checks to see if the mouse is within the bounds of the box, and if not than it will stop the execution of code.

Is there a better way to do this?

0 投票
2 回答
480 浏览

jquery - jquery悬停问题

我有时会遇到鼠标悬停问题,当我将鼠标快速移动到链接上时,它会循环很长一段时间,有没有办法只在鼠标悬停时才循环,如果鼠标不在则停止。