diff options
| author | Jacob Thornton <[email protected]> | 2012-10-17 22:26:44 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2012-10-17 22:26:44 -0700 |
| commit | edc3eee5eaae52384de1486639585c0b41318cf8 (patch) | |
| tree | 7c82af98402716dbbdd70d6ff2ff7a16648726b1 /docs/assets/js/bootstrap-carousel.js | |
| parent | 8e6697f2b20da705377d2a7a2eb6957a4df59d77 (diff) | |
| download | bootstrap-edc3eee5eaae52384de1486639585c0b41318cf8.tar.xz bootstrap-edc3eee5eaae52384de1486639585c0b41318cf8.zip | |
fix carousel event
Diffstat (limited to 'docs/assets/js/bootstrap-carousel.js')
| -rw-r--r-- | docs/assets/js/bootstrap-carousel.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/assets/js/bootstrap-carousel.js b/docs/assets/js/bootstrap-carousel.js index 0d7167e1c..b53315652 100644 --- a/docs/assets/js/bootstrap-carousel.js +++ b/docs/assets/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')) { @@ -167,7 +169,7 @@ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { var $this = $(this), href , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) + , options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data()) $target.carousel(options) e.preventDefault() }) |
