jQuery 旋转器,悬停在 div 和小缩略图导航上时暂停
下面是我想要更新新功能的 jsfiddle.net 代码:
http://jsfiddle.net/weigruf/mKj8p /
我想添加的是当您将鼠标悬停在 .rotator .rotator-child div 上时序列上的暂停和一个小缩略图导航,它将显示同一图像的小版本,您可以导航通过他们。
此外,缩略图导航也应该具有暂停效果。
提前致谢。 (:
编辑1:
我组合了代码,并用 .mouseenter 更新了代码,现在序列已暂停,但是我想在 .mouseleave 上恢复序列,并在光标位于 div 上时再次暂停。
请看一下:
Below is the jsfiddle.net code I want to update with new features:
http://jsfiddle.net/weigruf/mKj8p/
What I want to add is a pause on the sequence when you hover on .rotator .rotator-child div and a small thumbnail navigation that it will show a small version of the same image and you can navigate through them.
Also, the thumbnail navigation should have the pause effect as well.
Thanks in advance. (:
Edit 1:
I combined the codes and I updated the code with .mouseenter and now the sequence is paused, however I want to resume the sequence on .mouseleave and pause it again if the cursor is on the div.
Please take a look:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论如何,我都不是 jQuery/JS 专家,这不是一个有效的示例,但这可能会帮助您指明正确的方向。
我没有使用 setTimeout,而是使用 setInterval。鼠标悬停时,清除间隔,这样它就不会再次触发。在 mouseleave 上,等待 6 秒,然后运行函数 doRotate(),该函数将再次重新启动计时器,并加载新广告。
I'm no jQuery/JS expert by any means, and this is not a working example, but this might help point you in the right direction.
Instead of setTimeout, I used setInterval. On mouseover, clear the interval so it doesn't fire again. On mouseleave, wait 6 seconds, and run the function doRotate() which will restart the timer again, and load the new ad.