Created
November 14, 2014 16:55
-
-
Save clyfe/05a89c6ae297f4f620ce to your computer and use it in GitHub Desktop.
polymer smooth scroll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<core-animation id="animation" duration="300" easing="ease-in-out" fill="forwards"></core-animation> | |
... | |
var start = scroller.scrollTop; | |
var end = section.offsetTop; | |
var delta = end - start; | |
this.$.animation.target = scroller; | |
this.$.animation.customEffect = function (timeFraction, target, animation) { | |
target.scrollTop = start + delta * timeFraction; | |
}; | |
this.$.animation.play(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome, thanks!