mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
and pause on hover option to carousel
This commit is contained in:
parent
74a3c763b4
commit
fb74018ae2
Binary file not shown.
4
docs/assets/js/bootstrap-carousel.js
vendored
4
docs/assets/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
|
||||
|
@ -1310,6 +1310,12 @@ $('#myCollapsible').on('hidden', function () {
|
||||
<td>5000</td>
|
||||
<td>The amount of time to delay between automatically cycling an item.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pause</td>
|
||||
<td>string</td>
|
||||
<td>"hover"</td>
|
||||
<td>Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Markup</h3>
|
||||
|
6
docs/templates/pages/javascript.mustache
vendored
6
docs/templates/pages/javascript.mustache
vendored
@ -1234,6 +1234,12 @@ $('#myCollapsible').on('hidden', function () {
|
||||
<td>5000</td>
|
||||
<td>{{_i}}The amount of time to delay between automatically cycling an item.{{/i}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{_i}}pause{{/i}}</td>
|
||||
<td>{{_i}}string{{/i}}</td>
|
||||
<td>"hover"</td>
|
||||
<td>{{_i}}Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave.{{/i}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>{{_i}}Markup{{/i}}</h3>
|
||||
|
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…
x
Reference in New Issue
Block a user