and pause on hover option to carousel
This commit is contained in:
parent
74a3c763b4
commit
fb74018ae2
5 changed files with 20 additions and 0 deletions
4
js/bootstrap-carousel.js
vendored
4
js/bootstrap-carousel.js
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue