简体   繁体   English

轮播javascript几次

[英]carousel javascript several times

I wanna use this carousel :我想使用这个旋转木马:
[http://codepen.io/ScottMarshall/pen/FwxpH][1]
on a forum, but when I repeat the code, it doesn't work well.在论坛上,但是当我重复代码时,它不起作用。
Can you help me ?你能帮助我吗 ?

here, it's working, but the second container doesn't want and I don't want to change anything in the HTML...在这里,它正在工作,但第二个容器不想要,我不想更改 HTML 中的任何内容......

JSFiddle JSFiddle

Here is working fiddle: http://jsfiddle.net/1x6251wc/2/这是工作小提琴: http : //jsfiddle.net/1x6251wc/2/

This is the key change to get the context "Front" instead of all of them:这是获取上下文“Front”而不是所有上下文的关键更改:

var $front = $this.parent().find(".Front");

It's a poorly written plugin, but this change should get it to work across multiple instances.这是一个写得很糟糕的插件,但这个改变应该让它在多个实例中工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM