diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-02-25 09:51:39 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-02-25 09:51:39 +0400 |
commit | fb74018ae293588db84c6fbf2f4f07aa4da21c5e (patch) | |
tree | 5f3679116ba93be92760f0072135c34a2de384fd /js/bootstrap-carousel.js | |
parent | 74a3c763b47e146e354624cea56b73fbf514ad97 (diff) |
and pause on hover option to carousel
Diffstat (limited to 'js/bootstrap-carousel.js')
-rw-r--r-- | js/bootstrap-carousel.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index aef98fb05a..e0091a7d0a 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 = { @@ -136,6 +139,7 @@ $.fn.carousel.defaults = { interval: 5000 + , pause: 'hover' } $.fn.carousel.Constructor = Carousel |