File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
packages/theme-gungnir/components Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div
3
+ id =" theme-container"
3
4
class =" theme-container"
4
5
:class =" pageClasses"
5
6
@touchstart =" onTouchStart"
Original file line number Diff line number Diff line change @@ -97,11 +97,11 @@ export default {
97
97
98
98
methods: {
99
99
handleScroll () {
100
- var currentTop = window .pageYOffset
101
- var docuHeight = document .body .offsetHeight
102
- var windowHeight = document .documentElement .clientHeight
100
+ const currentTop = window .pageYOffset
101
+ const docuHeight = document .getElementById ( ' theme-container ' ) .offsetHeight
102
+ const windowHeight = document .documentElement .clientHeight
103
103
104
- var percent = currentTop / (docuHeight - windowHeight) * 100
104
+ let percent = currentTop / (docuHeight - windowHeight) * 100
105
105
if (percent > 100 ) percent = 100
106
106
107
107
if (isNaN (percent) || Math .round (percent) <= 0 ) {
You can’t perform that action at this time.
0 commit comments