循环 div 和缩略图
问题描述
我希望有人能救我!我正在尝试为我的页面创建一个(希望如此)简单的旋转横幅.我有 7 个包含照片和文字的 div,它们如下:
I'm hoping someone can save my me! I'm trying to create a (hopefully) simple rotating banner for my page. I have 7 divs that contain photos and text, they are as follows:
在这些 div 下方,我有 7 个相应的 div 缩略图:
And below those divs I have 7 corresponding divs that are thumbnails:
我想做几件事:
1) 每 5 秒循环通过一个新的 div(因此content-1"会显示 5 秒,然后是content 2"等.
1) Every 5 seconds cycle through a new div (so "content-1" would display for 5 seconds, then "content 2" etc.
2) 为当前缩略图应用一个名为cr-rotator"的类.我已经设置了样式.
2) Apply a class to the current thumbnail called "cr-rotator". I have the style already setup.
3) 当用户将鼠标悬停在主 div 或缩略图 div 上时,我希望能够暂停它的旋转.
3) I would like to be able to pause it from rotating when a user hovers over either the main div or thumbnail div.
4) 最后,我想拥有它,这样如果您将鼠标悬停在缩略图上,它会更改主要内容,然后在您关闭鼠标时继续循环.例如,假设您将鼠标悬停在thumb-content-3"上,它将使 divcontent-3"可见,然后当您将鼠标移出时,它将继续循环.
4) Lastly, I would like to have it so that if you hover over a thumbnail it would change the main content, then continue cycling when you mouse off. So say for example you hover over 'thumb-content-3' it will make the div 'content-3' visible and then when you mouse out it will continue cycling.
我知道这里有很多要求,我提前感谢任何可以帮助我的人.我已经获得了一个脚本来循环浏览主要图像,但我不确定如何实现其余部分:
I understand there is a lot demanded here and I thank in advance anyone who can help me out. I have been provided a script to cycle through the main images but I'm not sure how to implement the rest:
非常感谢任何可以帮助我的人.
Thank you so much to anyone that can help me.
推荐答案
Fade rotator - jsBin 演示
- 自动淡入淡出
- 悬停时暂停
- 悬停在拇指上会触发主幻灯片
- 在停止的地方重新启动
还有jQ代码:
这篇关于循环 div 和缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!