Skip to content

Commit 0ff36c2

Browse files
committed
fix(event): has no effect on a FF mobile browser, fixed #67
1 parent 19b6690 commit 0ff36c2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
## 2.3.0
22

33
> 2017-02-11
4+
5+
### Features
6+
47
- feat(src): add alias feature
58

9+
### Bug fixes
10+
- fix(event): `auto2top` has no effect on a FF mobile browser, fixed #67
11+
12+
613
## 2.2.1
714

815
> 2017-02-11

src/event.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ export function bindToggle (dom) {
135135
}
136136
}
137137

138+
const scrollingElement = document.scrollingElement || document.documentElement
139+
138140
export function scroll2Top (offset = 0) {
139-
document.body.scrollTop = offset === true ? 0 : Number(offset)
141+
scrollingElement.scrollTop = offset === true ? 0 : Number(offset)
140142
}
141143

142144
export function sticky () {

0 commit comments

Comments
 (0)