HTML是什么水平滚动条的高度?
-
19-08-2019 - |
题
有关的覆盖我需要知道一个垂直滚动条的高度。
我能做些什么来得到这个值?而且是高度在FireFox和相同的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设置,主题和OS版本也可以影响它。
不隶属于 StackOverflow