Twitter Bootstrap Carousel不滑动 [英] Twitter Bootstrap Carousel Not Sliding
问题描述
我遇到了一个有趣的问题。我很确定答案非常简单,但我无法理解,所以我想我会寻求帮助。
I ran into an interesting issue. I'm pretty sure that the answer is very simple, but I just couldn't figure it out so I thought I look for some help.
基本上,我的旋转木马没有不要滑它只是切换图像。我甚至尝试将确切的HTML从引导站点复制到我自己的页面中,但它仍然没有滑动。在application.js中,初始化也没有参数。
Basically, my carousel doesn't slide. It just switches image. I even tried copying the exact HTML from the bootstrap site into my own page and it still doesn't slide. In application.js, the initialization is also has no argument.
// carousel demo
$('#myCarousel').carousel()
我注意到点击pref时会将next和prev类添加到每个项目中/下一个按钮,但它似乎并没有对我做同样的事情。调试时我没有看到任何错误。
I notice that next and prev classes are added to each item when clicking pref/next button, but it doesn't seem to do the same thing on mine. I didn't see anything wrong when I debugged either.
我缺少什么?我在这两个最新的Chrome和Safari浏览器测试这一点。
What am I missing? I tested this in both latest Chrome and Safari.
推荐答案
您还必须添加引导过渡
用于滑动工作,如下所示:
You also have to add bootstrap-transition
for the sliding to work, like so:
<script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-transition.js"></script>
这篇关于Twitter Bootstrap Carousel不滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!