Created
September 11, 2018 14:26
-
-
Save snowleo208/23faf52d37a75e88ee8b1cd6acc1065c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scroll(element) { | |
let start = null; | |
const target = element && element? element.getBoundingClientRect().top : 0; | |
const firstPos = window.pageYOffset || document.documentElement.scrollTop; | |
let pos = 0; | |
window.requestAnimationFrame(showAnimation); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment