Skip to content

Instantly share code, notes, and snippets.

@ryanschuhler
Last active December 21, 2015 04:49
Show Gist options
  • Save ryanschuhler/6252575 to your computer and use it in GitHub Desktop.
Save ryanschuhler/6252575 to your computer and use it in GitHub Desktop.
Easy scroll navigation
AUI().use(
'anim',
function(A) {
A.all('.animate-scroll').on(
'click',
function(event) {
event.preventDefault();
var section = A.one(event.currentTarget.get('hash'));
var scrollTo = section.getY();
new A.Anim(
{
duration: 0.5,
easing: 'easeBoth',
node: 'win',
to: {
scroll: [0, scrollTo]
}
}
).run();
}
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment