Added linting, processed current snippets
This commit is contained in:
@ -6,10 +6,10 @@ Scroll by a fraction of the distance from top. Use `window.requestAnimationFrame
|
||||
```js
|
||||
const scrollToTop = _ => {
|
||||
const c = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if(c > 0) {
|
||||
if (c > 0) {
|
||||
window.requestAnimationFrame(scrollToTop);
|
||||
window.scrollTo(0, c - c/8);
|
||||
window.scrollTo(0, c - c / 8);
|
||||
}
|
||||
}
|
||||
};
|
||||
// scrollToTop()
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user