Skip to content

Instantly share code, notes, and snippets.

View nchristus's full-sized avatar

Nick Christus nchristus

  • Kansas City, MO
View GitHub Profile
@nchristus
nchristus / scrollTo.js
Created December 15, 2015 16:42 — forked from james2doyle/scrollTo.js
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};