update snippets 47-62

This commit is contained in:
Stefan Feješ
2017-12-25 14:16:05 +01:00
committed by Agamemnon Zorbas
parent 1c73c70b4a
commit 32fa5a9773
15 changed files with 65 additions and 22 deletions

View File

@ -9,5 +9,8 @@ You can omit `el` to use a default value of `window`.
const getScrollPosition = (el = window) =>
({x: (el.pageXOffset !== undefined) ? el.pageXOffset : el.scrollLeft,
y: (el.pageYOffset !== undefined) ? el.pageYOffset : el.scrollTop});
// getScrollPosition() -> {x: 0, y: 200}
```
```js
getScrollPosition() -> {x: 0, y: 200}
```