Carousel slide fire event (non-slippery) event, Bootstrap 3

Bootstrap 2 seems to handle the slide event perfectly (see this question ) with the following code:

$('#myCarousel').bind('slide', function (e) { console.log('slide event!'); }); 

I cannot, however, get the same for working in Bootstrap 3 (see this fiddle ). Does anyone know why?

+6
javascript jquery html twitter-bootstrap twitter-bootstrap-3
source share
2 answers

The actual event namespace for slide is according to the bootstrap3 implementation of slide.bs.carousel , unlike slide , which was one acc: to BS2, also use slid.bs.carousel to track the completion of the slide (although slid seems to work.)

So try:

 $('#myCarousel').bind('slide.bs.carousel', function (e) { console.log('slide event!'); }); 

Demo

+22
source share

On the slide before

 h('#HomeSlider').bind('slide.bs.carousel', function (e) { alert(h('#HomeSlider .item.active').html()); }); 

On the slide after

 h('#HomeSlider').on('slid.bs.carousel', function (e) { alert(h('#HomeSlider .item.active').html()); }); 
+8
source share

All Articles