admin管理员组文章数量:1356416
For an overlay i need to know the height of a vertical scrollbar.
What can i do to get this value? And is the height the same in FireFox and Internet Explorer?
Thnx
For an overlay i need to know the height of a vertical scrollbar.
What can i do to get this value? And is the height the same in FireFox and Internet Explorer?
Thnx
Share Improve this question edited Mar 11, 2015 at 8:33 S Gupta 1,5872 gold badges14 silver badges20 bronze badges asked Jan 19, 2009 at 11:06 MartijnMartijn 24.8k61 gold badges179 silver badges268 bronze badges1 Answer
Reset to default 10What can i do to get this value?
function getScrollSizes() { // call after document is finished loading
var el= document.createElement('div');
el.style.visibility= 'hidden';
el.style.overflow= 'scroll';
document.body.appendChild(el);
var w= el.offsetWidth-el.clientWidth;
var h= el.offsetHeight-el.clientHeight;
document.body.removeChild(el);
return new Array(w, h);
}
And is the height the same in FireFox and Internet Explorer?
No. The height isn't even the same in Internet Explorer and Internet Explorer. Variables such as dpi settings, theme and OS version can also affect it.
本文标签: javascriptHTML What is the height of a horizontal scrollbarStack Overflow
版权声明:本文标题:javascript - HTML What is the height of a horizontal scrollbar? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744037253a2580003.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论