I try to use this code to fire on an event upon carousel slide, but it fails to work for some reason. Any suggestions?
var $carousel = $('#carousel-showcase');
$carousel.carousel();
$carousel.bind('slide', function(e) {
setTimeout( function(){
var left = $carousel.find('.item.active.left');
var right = $carousel.find('.item.active.right');
if(left.length > 0) {
$("#wrap").animate({
backgroundPositionX: '+=50%'
},0);
}
else if(right.length > 0) {
$("#wrap").animate({
backgroundPositionX: '-=50%'
},0);
}
}, 500);
});