Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
8
test/scrollToTop/scrollToTop.js
Normal file
8
test/scrollToTop/scrollToTop.js
Normal file
@ -0,0 +1,8 @@
|
||||
const scrollToTop = () => {
|
||||
const c = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if (c > 0) {
|
||||
window.requestAnimationFrame(scrollToTop);
|
||||
window.scrollTo(0, c - c / 8);
|
||||
}
|
||||
};
|
||||
module.exports = scrollToTop;
|
||||
Reference in New Issue
Block a user