Skip to content

Instantly share code, notes, and snippets.

View YusifKhalilov's full-sized avatar
🎯
Focusing

Yusif Khalilov YusifKhalilov

🎯
Focusing
  • Los Angeles Movers
  • Los Angeles, CA
View GitHub Profile
@YusifKhalilov
YusifKhalilov / animatedScrollTo.js
Created September 14, 2018 17:04 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;