我的 slider 在页面加载后没有自动播放。如果我右键单击,则会打开自动播放。怎么了?
$('#myCarousel').on('slid', '', function() {
var $this = $(this);
$this.children('.carousel-control').show();
if($('.carousel-inner .item:first').hasClass('active')) {
$this.children('.left.carousel-control').hide();
}
else if($('.carousel-inner .item:last').hasClass('active')) {
$this.children('.right.carousel-control').hide();
}
}).trigger('slid');
最佳答案
把间隔调到最低
// invoke the carousel
$('#myCarousel').carousel({
interval: 2000
});
关于javascript - 页面加载后没有自动播放(Twitter Bootstrap 轮播),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14938293/