Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach "slide" & "slid" events to the Bootstrap toolkit's carousel?

Tags:

Here's a fiddle with a working Bootstrap carousel. http://jsfiddle.net/jeykeu/5TDff/

And here's the official documentation which tells nothing about event usage. http://twitter.github.com/bootstrap/javascript.html#carousel

I thought this would work but no:

     $('#carousel').bind('slide',function(){             alert("Slide Event");     }); 
like image 829
Junaid Qadir Shekhanzai Avatar asked Mar 11 '12 00:03

Junaid Qadir Shekhanzai


People also ask

How do you attach a slide to playground?

To Attach a Slide to a Swing, you have to fasten the two together. If you have a wooden swing, this can be accomplished with wood screws. If you have a metal swing set, you can use sheet metal screws or choose to use bolts. Line everything up, drill your holes, and install your fasteners of choice.

What to put on a metal slide to make it slippery?

This makes the wax apply easier. This is one of the best ways to make a slide slippery again. While removing dirt from your slide on its own helps, waxing the slide really brings back the slick ride that the slide boasted when it was new. To do this safely, we recommend rubbing wax paper over the entire slide surface.

How high should a slide be off the ground?

– Be at least 7 inches but not more than 15 inches above the protective surfacing if the slide is over 4 feet high.


1 Answers

Based on your fiddle #carousel is wrong. It should be #myCarousel.

Updated Example:

$('#myCarousel').carousel({     interval: 2000 });  // Could be slid or slide (slide happens before animation, slid happens after) $('#myCarousel').on('slid', function() {     alert("Slide Event"); });​ 

http://jsfiddle.net/infiniteloops/wPF3n/

With Bootstrap 3

http://jsfiddle.net/infiniteloops/wPF3n/252/

like image 86
Gary.S Avatar answered Sep 30 '22 09:09

Gary.S