diff --git a/examples/hello-world/index.html b/examples/hello-world/index.html index 1c6176d..a25720a 100644 --- a/examples/hello-world/index.html +++ b/examples/hello-world/index.html @@ -5,7 +5,7 @@
- + Scroll to Hello World section diff --git a/src/index.js b/src/index.js index e500e96..c887c6b 100644 --- a/src/index.js +++ b/src/index.js @@ -28,7 +28,7 @@ const init = ({ el.addEventListener('click', e => { e.preventDefault() - const begin = document.body.scrollTop + const begin = document.documentElement.scrollTop || document.body.scrollTop const end = begin + target.getBoundingClientRect().top const startTime = Date.now()