Skip to content

Commit

Permalink
Merge pull request #22 from usefulthink/animation-speed-option
Browse files Browse the repository at this point in the history
Introduce option for animation-speed. Looks good. Thanks for your work.
  • Loading branch information
swernerx committed Jun 22, 2012
2 parents 23ee166 + 2dabd9b commit 490ae12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ These are the available options with their defaults. Options can be modified usi
* scrollingX = `true`
* scrollingY = `true`
* animating = `true`
* animationDuration = `250`
* bouncing = `true`
* locking = `true`
* paging = `false`
Expand Down Expand Up @@ -100,4 +101,4 @@ To zoom using the `mousewheel` event just pass the data like this:

* `doMouseZoom(e.wheelDelta, e.timeStamp, e.pageX, e.pageY);`

For more information about this please take a look at the demos.
For more information about this please take a look at the demos.
5 changes: 4 additions & 1 deletion src/Scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ var Scroller;
/** Enable animations for deceleration, snap back, zooming and scrolling */
animating: true,

/** duration for animations triggered by scrollTo/zoomTo */
animationDuration: 250,

/** Enable bouncing (content can be slowly moved outside and jumps back after releasing) */
bouncing: true,

Expand Down Expand Up @@ -1044,7 +1047,7 @@ var Scroller;
};

// When continuing based on previous animation we choose an ease-out animation instead of ease-in-out
self.__isAnimating = core.effect.Animate.start(step, verify, completed, 250, wasAnimating ? easeOutCubic : easeInOutCubic);
self.__isAnimating = core.effect.Animate.start(step, verify, completed, self.options.animationDuration, wasAnimating ? easeOutCubic : easeInOutCubic);

} else {

Expand Down

0 comments on commit 490ae12

Please sign in to comment.