Jquery 悬停时动画
我正在寻找一个非常基本的功能:当鼠标悬停在窗口的某个区域上时,我想为 div 的位置设置动画。 我已经弄清楚如何以及何时触发动画功能,问题是它的时间有限。我正在寻找一种在悬停时相对于其位置移动 div 的方法。
干杯,janik
编辑:
我创建了一个 JDfiddle。以前不知道有这个。 jsfiddle.net/Ru2mZ/7 为了解决我的问题:当鼠标悬停在按钮上时,我想要一个对象的连续移动或动画。因此像 $('#id').animate({left: 100},100) 这样的基本动画不起作用,因为它仅限于固定的结束位置和固定的时间。
I'm looking for a very basic feature: I want to animate a div in it's position while the mouse hovers over a certain area of the window.
I've already figured out how and when to fire off the animate function the problem is, that it's limited in its time. I'm looking for a way to move the div relative to it's position while hovering.
Cheers, janik
Edit:
I've created a JDfiddle. Didn't know about that before. jsfiddle.net/Ru2mZ/7 To render out my problem: I want a continuous movement or animation of an object while the mouse is over the button. So a basic animation like $('#id').animate({left: 100},100) wouldn't work since it's limited to a fixed end position and a fixed amount of time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是悬停功能的文档。
http://api.jquery.com/hover/
基本上,你必须
Here is the documentation of the hover function.
http://api.jquery.com/hover/
Basically, you have to