Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Bootstrap Carousel to go to a specific index?

I'm using Bootstrap and Bootstrap Carousel in a project.

I would like to know if there's any way to make the Carousel navigate to a specific slide.
For example, something like:

$('myCarousel').to(2);

Does anybody know a way to do this?

like image 985
Matheus Lima Avatar asked Apr 02 '12 18:04

Matheus Lima


1 Answers

From the documentation:

.carousel(number) Cycles the carousel to a particular frame (0 based, similar to an array).

So I think it should be:

 $('myCarousel').carousel(2);
like image 113
matma Avatar answered Sep 21 '22 23:09

matma