执行期间暂停 jQuery 效果
我的网站有一些图标在鼠标悬停时会发光,但我希望它在没有人悬停时随机发光。
现在我有正确的代码片段,可以使其随机发光并在悬停时发光,但如何在人将鼠标悬停在图标上后停止并恢复随机发光。
谢谢。
My website has some icons that glows on mouse over but I want it to glow randomly when no one is hovering.
Right now I have the correct piece of codes that will make it randomly glow and glow on hover but how to make the random glow stop and resume after a person has hovered over the icons.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于您没有提供太多信息,这就是我想要做的:
Since you haven't provided much information, this is what I would think of doing:
您可以使用
.stop()
停止任何现有效果。然而,一旦您的悬停启动的附加效果完成,就没有任何方法可以恢复这些效果。
您必须在第二个
.hover()
回调中重新启动“随机”发光。编辑它可能是可能的,但这未经测试:
.queue()
来获取当前的动画队列,并复制结果.hover()
的“out”函数中的新动画的You can use
.stop()
to cease any existing effects.However there isn't (AFAIK) any way to resume those effects once the additional effects started by your hover have finished.
You'd have to restart your "random" glowing in the second
.hover()
callback.EDIT it may be possible, but this is untested:
.queue()
to get the current animation queue, and copy the results.stop()
to remove all those.hover()
's "out" function, re-instate the queued items from #1 above您可以在发光之前检查它们的图标是否发光:
You can check to see if they icon is glowing before you glow it: