diff options
| author | Jonathan Camile <[email protected]> | 2012-02-28 11:06:05 +0100 |
|---|---|---|
| committer | Jonathan Camile <[email protected]> | 2012-02-28 11:06:05 +0100 |
| commit | a397130669a1462abff703989c38a63b0d2d63f0 (patch) | |
| tree | 71eab5c69724af04f68ed9fcf6edc7735e6b690a /js/bootstrap-carousel.js | |
| parent | 15759d9e7c5284016f76c08065f407386ae7348a (diff) | |
| parent | fbebb046f7134eaed90492bfc67720337c4b625e (diff) | |
| download | bootstrap-a397130669a1462abff703989c38a63b0d2d63f0.tar.xz bootstrap-a397130669a1462abff703989c38a63b0d2d63f0.zip | |
Merge branch '2.0.2-wip' of https://github.com/twitter/bootstrap into features/warning_progress_bar
Diffstat (limited to 'js/bootstrap-carousel.js')
| -rw-r--r-- | js/bootstrap-carousel.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 810256e80..e0091a7d0 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -29,6 +29,9 @@ this.$element = $(element) this.options = $.extend({}, $.fn.carousel.defaults, options) this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) } Carousel.prototype = { @@ -83,14 +86,14 @@ , fallback = type == 'next' ? 'first' : 'last' , that = this - if (!$next.length) return - this.sliding = true isCycling && this.pause() $next = $next.length ? $next : this.$element.find('.item')[fallback]() + if ($next.hasClass('active')) return + if (!$.support.transition && this.$element.hasClass('slide')) { this.$element.trigger('slide') $active.removeClass('active') @@ -136,6 +139,7 @@ $.fn.carousel.defaults = { interval: 5000 + , pause: 'hover' } $.fn.carousel.Constructor = Carousel |
