From edc3eee5eaae52384de1486639585c0b41318cf8 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 17 Oct 2012 22:26:44 -0700 Subject: fix carousel event --- js/bootstrap-carousel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 0852cf3f43..b533156526 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -94,9 +94,7 @@ , direction = type == 'next' ? 'left' : 'right' , fallback = type == 'next' ? 'first' : 'last' , that = this - , e = $.Event('slide', { - relatedTarget: $next[0] - }) + , e this.sliding = true @@ -104,6 +102,10 @@ $next = $next.length ? $next : this.$element.find('.item')[fallback]() + e = $.Event('slide', { + relatedTarget: $next[0] + }) + if ($next.hasClass('active')) return if ($.support.transition && this.$element.hasClass('slide')) { -- cgit v1.2.3