Mar*_*ijn 4 html javascript height scroll
对于叠加层,我需要知道垂直滚动条的高度.
我能做些什么来获得这个价值?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);
}
Run Code Online (Sandbox Code Playgroud)
FireFox和Internet Explorer的高度是否相同?
不可以.Internet Explorer和Internet Explorer中的高度甚至不同.dpi设置,主题和操作系统版本等变量也会影响它.
归档时间: |
|
查看次数: |
3878 次 |
最近记录: |