diff --git a/README.md b/README.md index 3480f7f8e..cb5d6c3df 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ const flatten = arr => arr.reduce( (a, v) => a.concat(v), []); // flatten([1,[2],3,4) -> [1,2,3,4] ``` -## Get scroll position +### Get scroll position Use `pageXOffset` and `pageYOffset` if they are defined, otherwise `scrollLeft` and `scrollTop`. You can omit `el` to use a default value of `window`. diff --git a/snippets/get-scroll-position.md b/snippets/get-scroll-position.md index ea823fd18..7e367168f 100644 --- a/snippets/get-scroll-position.md +++ b/snippets/get-scroll-position.md @@ -1,4 +1,4 @@ -## Get scroll position +### Get scroll position Use `pageXOffset` and `pageYOffset` if they are defined, otherwise `scrollLeft` and `scrollTop`. You can omit `el` to use a default value of `window`.