HTML水平滚动条的高度是多少?(HTML What is the height of a horizontal scrollbar?)
对于叠加层,我需要知道垂直滚动条的高度。
我能做些什么才能获得这个价值? FireFox和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
最满意答案
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); }我能做些什么才能获得这个价值?
FireFox和Internet Explorer的高度是否相同?
不可以.Internet Explorer和Internet Explorer中的高度甚至不同。 dpi设置,主题和操作系统版本等变量也会影响它。
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); }What can i do to get this value?
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.
更多推荐
发布评论