URL87
URL87

Reputation: 11012

Bootstrap.js Carousel load specific item

I have a Bootstrap.js Carousel based on this tutorial , it has 4 view item , each one looks like that -

<div class="item active"><!-- class of active since it's the first item -->
          <div class="carousel-caption">
            <p>Caption text1 here</p>
          </div>
</div>

Demo here - http://jsfiddle.net/urielz/yu4qE/3/

it also has right and left buttons which slide the content on the menu according the the items order .

So my question is -

Which command (probably any jQuery selector) would cause to load a specific "item" to the menu ?

For example , something like - $('.carousel')[3].showOnMenu(...) to load the 4nd item on the menu .

Upvotes: 0

Views: 294

Answers (1)

Rituraj ratan
Rituraj ratan

Reputation: 10378

use .carousel(number)method in carousel

$(document).ready(function(){
        $('.carousel').carousel({
          interval: 7000
        });
        $('.carousel').carousel(2);// use this here it index 0 base 
      });

UPDATED FIDDLE

reference http://getbootstrap.com/javascript/#carousel

Upvotes: 2

Related Questions