diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de3b3a6e..553df7021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ ## 2.3.0 > 2017-02-11 + +### Features + - feat(src): add alias feature +### Bug fixes +- fix(event): `auto2top` has no effect on a FF mobile browser, fixed #67 + + ## 2.2.1 > 2017-02-11 diff --git a/src/event.js b/src/event.js index 72130cc2b..b4df38714 100644 --- a/src/event.js +++ b/src/event.js @@ -135,8 +135,10 @@ export function bindToggle (dom) { } } +const scrollingElement = document.scrollingElement || document.documentElement + export function scroll2Top (offset = 0) { - document.body.scrollTop = offset === true ? 0 : Number(offset) + scrollingElement.scrollTop = offset === true ? 0 : Number(offset) } export function sticky () {