changing _ to ()
This commit is contained in:
@ -4,7 +4,7 @@ Get distance from top using `document.documentElement.scrollTop` or `document.bo
|
|||||||
Scroll by a fraction of the distance from top. Use `window.requestAnimationFrame()` to animate the scrolling.
|
Scroll by a fraction of the distance from top. Use `window.requestAnimationFrame()` to animate the scrolling.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const scrollToTop = _ => {
|
const scrollToTop = () => {
|
||||||
const c = document.documentElement.scrollTop || document.body.scrollTop;
|
const c = document.documentElement.scrollTop || document.body.scrollTop;
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
window.requestAnimationFrame(scrollToTop);
|
window.requestAnimationFrame(scrollToTop);
|
||||||
|
|||||||
Reference in New Issue
Block a user