Twitter bootstrap 引导转盘暂停不工作
我无法在引导(3.0.2)转盘上调用“暂停”功能。我已经尝试了所有我能想到的方法来引用carousel实例,但是-没有错误,没有停顿Twitter bootstrap 引导转盘暂停不工作,twitter-bootstrap,carousel,Twitter Bootstrap,Carousel,我无法在引导(3.0.2)转盘上调用“暂停”功能。我已经尝试了所有我能想到的方法来引用carousel实例,但是-没有错误,没有停顿 <script> var stepIndex = 3; $('.carousel').carousel({ interval: 3000 }); $('#carousel-couples').on('slide.bs.carousel', function () { stepIndex--
<script>
var stepIndex = 3;
$('.carousel').carousel({
interval: 3000
});
$('#carousel-couples').on('slide.bs.carousel', function () {
stepIndex--
console.log("carousel stepping", stepIndex);
if (stepIndex == 0) {
console.log("supposedly pausing carousel");
$('.carousel').carousel('pause');
}
})
</script>
</body>
</html>
var指数=3;
$('.carousel')。carousel({
间隔时间:3000
});
$('#carousel couples')。on('slide.bs.carousel',function(){
阶跃指数--
console.log(“旋转木马步进”,步进索引);
如果(stepIndex==0){
log(“假定暂停转盘”);
$('.carousel')。carousel('pause');
}
})
在旋转木马的滑动似乎不起作用时调用暂停。在幻灯片完成转换后,使用slided.bs.carousel
事件运行,然后您的pause
应该可以工作
$('#carousel-couples').on('slid.bs.carousel', function () {
...
});
好吧,这就是诀窍——虽然我确实在挣扎中尝试过,但我不知道为什么它当时不起作用。谢谢!