I hereby claim:
- I am alexanderkraemer on github.
- I am alexanderkraemer (https://keybase.io/alexanderkraemer) on keybase.
- I have a public key ASDGAGMuHr7V4zjYFgSnmI78KR7CJGmx03Up34UUV27aGgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
function smoothScroll(el, to, duration) { | |
if (duration < 0) { | |
return; | |
} | |
var difference = to - $(window).scrollTop(); | |
var perTick = difference / duration * 10; | |
$(this).scrollToTimerCache = setTimeout(function() { | |
if (!isNaN(parseInt(perTick, 10))) { | |
window.scrollTo(0, $(window).scrollTop() + perTick); | |
smoothScroll(el, to, duration - 10); |