0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

calling pause on a slide should actually pause it - even when hovering

This commit is contained in:
Jacob Thornton 2012-04-14 17:49:51 -07:00
parent 34132f0e89
commit 82267d48ff
4 changed files with 17 additions and 10 deletions

Binary file not shown.

View File

@ -37,8 +37,10 @@
Carousel.prototype = {
cycle: function () {
cycle: function (e) {
if (!e) this.paused = false
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
@ -64,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
}
, pause: function () {
, pause: function (e) {
if (!e) this.paused = true
clearInterval(this.interval)
this.interval = null
return this

View File

@ -1,9 +1,10 @@
{
"browser" : true,
"expr" : true,
"laxbreak" : true,
"boss" : true,
"asi" : true,
"validthis": true,
"laxcomma" : true,
"validthis": true
"laxbreak" : true,
"browser" : true,
"debug" : true,
"boss" : true,
"expr" : true,
"asi" : true
}

View File

@ -37,8 +37,10 @@
Carousel.prototype = {
cycle: function () {
cycle: function (e) {
if (!e) this.paused = false
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
@ -64,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
}
, pause: function () {
, pause: function (e) {
if (!e) this.paused = true
clearInterval(this.interval)
this.interval = null
return this