Commit 987ca8cf21cf2e2f0bda7b2d8713a2c6cfdffa21
Committed by
GitHub
Merge pull request #1013 from itrenhang/2.0
backTop
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
src/components/back-top/back-top.vue
@@ -67,7 +67,8 @@ | @@ -67,7 +67,8 @@ | ||
67 | this.backTop = window.pageYOffset >= this.height; | 67 | this.backTop = window.pageYOffset >= this.height; |
68 | }, | 68 | }, |
69 | back () { | 69 | back () { |
70 | - scrollTop(window, document.body.scrollTop, 0, this.duration); | 70 | + var sTop = document.documentElement.scrollTop||document.body.scrollTop; |
71 | + scrollTop(window, sTop, 0, this.duration); | ||
71 | this.$emit('on-click'); | 72 | this.$emit('on-click'); |
72 | } | 73 | } |
73 | } | 74 | } |