简体   繁体   English

我怎样才能让旋转木马继续骑自行车?

[英]How can I keep carousel keep cycling?

Apparently, the demo page on the http://twitter.github.com/bootstrap/javascript.html#carousel seems to have carousel stop rotating after it reaches the right most picture in the slide. 显然, http://twitter.github.com/bootstrap/javascript.html#carousel上的演示页面似乎在旋转木马到达幻灯片中最右边的图片后停止旋转。

The demo used $('#myCarousel').carousel() to start carousel. 该演示使用$('#myCarousel').carousel()来启动轮播。

I tried 我试过了

$('#myCarousel').carousel()

and

$('#myCarousel').carousel('cycle')

but carousel kept stopping when it reaches to the last picture. 但旋转木马到达最后一张照片时一直停下来。

I have seen some posts on the web that people actually want to stop it from cycling forever, which was posted like 3 weeks ago. 我在网上看到一些帖子,人们实际上想要阻止它永远骑自行车,就像3周前一样。 http://groups.google.com/group/twitter-bootstrap/browse_thread/thread/9eeedbb0e68789e3/bf99468117bd669a http://groups.google.com/group/twitter-bootstrap/browse_thread/thread/9eeedbb0e68789e3/bf99468117bd669a

What should I do so that my carousel will continue rotating after it reaches the last picture? 我该怎么做才能使我的旋转木马在到达最后一张照片后继续旋转?

This is actually a bug that has been fixed in 2.0.2 这实际上是2.0.2中修复的错误

You can try deleting line 86 in bootstrap-carousel.js which is, 您可以尝试删除bootstrap-carousel.js中的第86行,

if (!$next.length) return

See: issue 2036 见: 问题2036

We created an infinite jquery scroller for our corporate site. 我们为公司网站创建了一个无限的jquery滚动条。 Our approach was, as each image was scrolled off of the screen we'd clone it, append the clone to the opposite side, and remove the one that just left the viewable area. 我们的方法是,当每个图像从屏幕上滚动时我们将其克隆,将克隆附加到另一侧,并移除刚离开可视区域的那个。

try this. 尝试这个。

$('.carousel').carousel()

It's literally from the bootstrap site. 它实际上来自bootstrap网站。 Makes no sense to me that this would not be instance specific. 对我没有任何意义,这不是特定于实例的。 But there is some room for improvement in the doc anyway. 但无论如何,文档还有一些改进空间。

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

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