Added linting, processed current snippets

This commit is contained in:
Angelos Chalaris
2017-12-14 00:05:44 +02:00
parent 2674273efc
commit bf855e55e2
35 changed files with 2079 additions and 76 deletions

View File

@ -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()
```