单页上具有多个实例的 jQuery 图像旋转器
美好的一天,
我已经搜索和研究了这个问题 12 个小时,但找不到解决我的问题的方法。因为我不太了解 Javascript 和 jQuery,所以我不太确定要寻找和搜索什么。
我已经在我的网站上实现了这个 jQuery 图像旋转器成功并且它与在页面上工作的旋转器实例一起出色地工作。现在,我想知道是否可以让多个旋转器同时在单个页面上工作。
到目前为止我的努力还没有成功。两个旋转器将正确加载,但第一个旋转器的第一个图像将开始播放。然后,将切换到第二个旋转器并继续旋转该旋转器,而第一个旋转器留空。
对此的任何帮助和指导将不胜感激。
Good day,
I've searched and researched this for the past 12 hours and can't find a solution to my problem. And because I'm not too clued up on Javascript and jQuery I'm not exactly sure what to look for and search for.
I've implemented this jQuery Image Rotator on my site successfully and its working brilliantly with one instance of the rotator working on a page. Now, I want to know if its possible to get more than one rotator working on a single page, at the same time.
My efforts so far haven't been successful. The two rotators will load properly, but the first image of the first rotator will start playing. And then, will switch over to the second rotator and continue rotating that one, while the first one is left blank.
Any help and direction on this will be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从目前的实施来看,没有。旋转器代码显式地对与
div#rotator
匹配的内容进行操作,其中应该最多是一个元素。执行类似以下操作即可解决问题 - 传递包含
ul
的 div 的id
。As it is currently implemented, no. The rotator code explicitly operates on the contents of whatever matches
div#rotator
, which should be at most one element.Doing something like the following would do the trick - pass in the
id
of the div containing theul
.