Commit 00717980 authored by JingChao's avatar JingChao

Update index.vue

parent 0eb9183b
......@@ -66,20 +66,20 @@ export default {
do {
if (nextElement) {
let position = window.getComputedStyle(nextElement).position
if (position === 'fixed') {
if (position !== 'fixed') {
let elHeight = window.getComputedStyle(nextElement).height
let part = /^\d+(\.\d+)?px$/
if (elHeight && part.test(elHeight)) {
nextHeight += Number(elHeight.replace('px', ''))
}
let paddingTopHeight = window.getComputedStyle(nextElement).paddingTop
let paddingBottomHeight = window.getComputedStyle(nextElement).paddingBottom
if (paddingTopHeight && part.test(paddingTopHeight)) {
nextHeight += Number(paddingTopHeight.replace('px', ''))
}
if (paddingBottomHeight && part.test(paddingBottomHeight)) {
nextHeight += Number(paddingBottomHeight.replace('px', ''))
}
//let paddingTopHeight = window.getComputedStyle(nextElement).paddingTop
//let paddingBottomHeight = window.getComputedStyle(nextElement).paddingBottom
//if (paddingTopHeight && part.test(paddingTopHeight)) {
// nextHeight += Number(paddingTopHeight.replace('px', ''))
//}
//if (paddingBottomHeight && part.test(paddingBottomHeight)) {
// nextHeight += Number(paddingBottomHeight.replace('px', ''))
//}
}
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