Permalink
Browse files

Merge pull request #19 from gerrit/stop

Stop
  • Loading branch information...
2 parents 055b78c + bd0895d commit 20d6884884005b0e1e2d0caab0a978cf91006b91 Brad Birdsall committed Dec 20, 2011
Showing with 13 additions and 3 deletions.
  1. +12 −2 swipe.js
  2. +1 −1 swipe.min.js
View
@@ -111,7 +111,7 @@ Swipe.prototype = {
prev: function(delay) {
- // cancel slideshow
+ // cancel next scheduled automatic transition, if any
this.delay = delay || 0;
clearTimeout(this.interval);
@@ -122,7 +122,7 @@ Swipe.prototype = {
next: function(delay) {
- // cancel slideshow
+ // cancel next scheduled automatic transition, if any
this.delay = delay || 0;
clearTimeout(this.interval);
@@ -142,6 +142,16 @@ Swipe.prototype = {
: 0;
},
+
+ stop: function() {
+ this.delay = 0;
+ clearTimeout(this.interval);
+ },
+
+ resume: function() {
+ this.delay = this.options.auto || 0;
+ this.begin();
+ },
handleEvent: function(e) {
switch (e.type) {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 20d6884

Please sign in to comment.