Julie
Julie

Reputation: 125

No autoplay after page load (Twitter bootstrap carousel)

My slider is not autoplaying after page load. If I right-click, autoplay is turned on. What is wrong?

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

Upvotes: 1

Views: 3391

Answers (1)

Shail
Shail

Reputation: 3649

Set the interval to the lowest

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

Upvotes: 2

Related Questions