Skip to content

Instantly share code, notes, and snippets.

@clyfe
Created November 14, 2014 16:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save clyfe/05a89c6ae297f4f620ce to your computer and use it in GitHub Desktop.
Save clyfe/05a89c6ae297f4f620ce to your computer and use it in GitHub Desktop.
polymer smooth scroll
<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();
@pflannery
Copy link

awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment