Skip to content

Commit

Permalink
Update js/bootstrap-carousel.js
Browse files Browse the repository at this point in the history
added `, mouseover` to prevent the slide from happening if the mouse clicked on the indicator icons
removed `this.cycle()` from the pause function to prevent the carousel from sliding when we hover over the carousel in the middle of a slide
  • Loading branch information
Yohn committed Dec 23, 2012
1 parent 48211ad commit 620338c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/bootstrap-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseenter, mouseover', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}

Expand Down Expand Up @@ -74,7 +74,6 @@
if (!e) this.paused = true
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
this.$element.trigger($.support.transition.end)
this.cycle()
}
clearInterval(this.interval)
this.interval = null
Expand Down Expand Up @@ -203,4 +202,4 @@
e.preventDefault()
})

}(window.jQuery);
}(window.jQuery);

0 comments on commit 620338c

Please sign in to comment.