HTML水平滚动条的高度是多少?(HTML What is the height of a horizontal scrollbar?)

编程入门 行业动态 更新时间:2024-10-23 03:28:30
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设置,主题和操作系统版本等变量也会影响它。

What 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.

更多推荐

本文发布于:2023-08-06 15:25:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1451192.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:滚动条   高度   水平   HTML   horizontal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!