ran npm run tdd & generated TDD
This commit is contained in:
7
test/scrollToTop/scrollToTop.js
Normal file
7
test/scrollToTop/scrollToTop.js
Normal file
@ -0,0 +1,7 @@
|
||||
module.exports = () => {
|
||||
const c = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if (c > 0) {
|
||||
window.requestAnimationFrame(scrollToTop);
|
||||
window.scrollTo(0, c - c / 8);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user