标签:body off rem cti element height llb fse nod
function getScrollBarHW() {
if (this.scrollBarHW) {
return this.scrollBarHW;
}
var div = document.createElement(‘div‘);
div.style.overflow = ‘scroll‘;
div.style.visibility = ‘hidden‘;
div.style.position = ‘absolute‘;
div.style.width = ‘100px‘;
div.style.height = ‘100px‘;
document.body.appendChild(div);
this.scrollBarHW = {
width : div.offsetWidth - div.clientWidth,
};
div.parentNode.removeChild(div);
return this.scrollBarHW.width;
}
alert(getScrollBarHW())
标签:body off rem cti element height llb fse nod
原文地址:http://www.cnblogs.com/vue-move/p/6930274.html