Permalink
Browse files

Let slide(index) default to preset speed

I would expect the slide method to use the default speed if none was
passed to the function. Added that functionality.
  • Loading branch information...
1 parent 1e552f3 commit 117629869ee31cff1aefbc16bea7bdd0210ccacd @solidfox solidfox committed Apr 6, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 swipe.js
View
@@ -90,6 +90,11 @@ Swipe.prototype = {
var style = this.element.style;
+ // fallback to default speed
+ if (duration == undefined) {
+ duration = this.speed;
+ }
+
// set duration speed (0 represents 1-to-1 scrolling)
style.webkitTransitionDuration = style.MozTransitionDuration = style.msTransitionDuration = style.OTransitionDuration = style.transitionDuration = duration + 'ms';

0 comments on commit 1176298

Please sign in to comment.