changing _ to ()

This commit is contained in:
Kladdkaka
2017-12-17 11:55:41 +01:00
committed by GitHub
parent 5cf046de09
commit ffabf8d94c

View File

@ -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);