2013-02-18 42 views
1

我的滑塊在頁面加載後不是自動播放。如果我右鍵單擊,自動播放功能已打開。哪裏不對?頁面加載後沒有自動播放(Twitter引導轉盤)

$('#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'); 

回答

2

將間隔設置爲最低

// invoke the carousel 
    $('#myCarousel').carousel({ 
    interval: 2000 
    });