Commit 82267d48 authored by Jacob Thornton's avatar Jacob Thornton

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

parent 34132f0e
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
Carousel.prototype = { Carousel.prototype = {
cycle: function () { cycle: function (e) {
if (!e) this.paused = false
this.options.interval this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this return this
} }
...@@ -64,7 +66,8 @@ ...@@ -64,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
} }
, pause: function () { , pause: function (e) {
if (!e) this.paused = true
clearInterval(this.interval) clearInterval(this.interval)
this.interval = null this.interval = null
return this return this
......
{ {
"browser" : true, "validthis": true,
"expr" : true, "laxcomma" : true,
"laxbreak" : true, "laxbreak" : true,
"browser" : true,
"debug" : true,
"boss" : true, "boss" : true,
"asi" : true, "expr" : true,
"laxcomma" : true, "asi" : true
"validthis": true
} }
\ No newline at end of file
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
Carousel.prototype = { Carousel.prototype = {
cycle: function () { cycle: function (e) {
if (!e) this.paused = false
this.options.interval this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this return this
} }
...@@ -64,7 +66,8 @@ ...@@ -64,7 +66,8 @@
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
} }
, pause: function () { , pause: function (e) {
if (!e) this.paused = true
clearInterval(this.interval) clearInterval(this.interval)
this.interval = null this.interval = null
return this return this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment