Commit 00717980 authored by JingChao's avatar JingChao

Update index.vue

parent 0eb9183b
...@@ -66,20 +66,20 @@ export default { ...@@ -66,20 +66,20 @@ export default {
do { do {
if (nextElement) { if (nextElement) {
let position = window.getComputedStyle(nextElement).position let position = window.getComputedStyle(nextElement).position
if (position === 'fixed') { if (position !== 'fixed') {
let elHeight = window.getComputedStyle(nextElement).height let elHeight = window.getComputedStyle(nextElement).height
let part = /^\d+(\.\d+)?px$/ let part = /^\d+(\.\d+)?px$/
if (elHeight && part.test(elHeight)) { if (elHeight && part.test(elHeight)) {
nextHeight += Number(elHeight.replace('px', '')) nextHeight += Number(elHeight.replace('px', ''))
} }
let paddingTopHeight = window.getComputedStyle(nextElement).paddingTop //let paddingTopHeight = window.getComputedStyle(nextElement).paddingTop
let paddingBottomHeight = window.getComputedStyle(nextElement).paddingBottom //let paddingBottomHeight = window.getComputedStyle(nextElement).paddingBottom
if (paddingTopHeight && part.test(paddingTopHeight)) { //if (paddingTopHeight && part.test(paddingTopHeight)) {
nextHeight += Number(paddingTopHeight.replace('px', '')) // nextHeight += Number(paddingTopHeight.replace('px', ''))
} //}
if (paddingBottomHeight && part.test(paddingBottomHeight)) { //if (paddingBottomHeight && part.test(paddingBottomHeight)) {
nextHeight += Number(paddingBottomHeight.replace('px', '')) // nextHeight += Number(paddingBottomHeight.replace('px', ''))
} //}
} }
nextElement = nextElement.nextElementSibling nextElement = nextElement.nextElementSibling
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment