function getTotalHeight(element) {
if (document.defaultView) {
h = element.offsetHeight
+ px2Int(getComputedStyle(element, '').getPropertyValue("padding-top"))
+ px2Int(getComputedStyle(element, '').getPropertyValue("padding-bottom"))
+ px2Int(getComputedStyle(element, '').getPropertyValue("border-top-width"))
+ px2Int(getComputedStyle(element, '').getPropertyValue("border-bottom-width"))
+ px2Int(getComputedStyle(element, '').getPropertyValue("margin-top"))
+ px2Int(getComputedStyle(element, '').getPropertyValue("margin-bottom"));
} else {
h = element.offsetHeight
+ px2Int(element.currentStyle.paddingTop)
+ px2Int(element.currentStyle.paddingBottom)
+ px2Int(element.currentStyle.borderTopWidth)
+ px2Int(element.currentStyle.borderBottomWidth)
+ px2Int(element.currentStyle.marginTop)
+ px2Int(element.currentStyle.marginBottom);
}
return h;
}
253



被折叠的 条评论
为什么被折叠?



