Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap Carousel skipping issue

On the site I'm working on the carousel seems to skip to the third image the first time you click on the next button when the page loads. Does anyone have any ideas as to why this is? I'm following the suggested layout from the bootstrap documentation.

like image 990
TheoretiCAL Avatar asked Jul 28 '12 19:07

TheoretiCAL


1 Answers

There seems to be a problem with the initialization of the carousel.

When you click for the first time on the arrow, it initializes the carousel which triggers the first switch AND select the next slide because you clicked on the arrow (all at the same time).

A direct fix would be to add this code to initialize the carousel on loading (which also enable the automatic sliding) :

$(function() {
    $('#myCarousel').carousel();
});

Be sure to include this after the plugin and everything should be okay.

Update

It also appears to be jumping to the 3rd only without the transition effect.

As suggested by merv you could include the bootstrap-transition.js file and it will resolve your problem.

Anyway, I submitted a ticket, for those who wants some follow-up : Issue on github

like image 123
Sherbrow Avatar answered Sep 28 '22 17:09

Sherbrow