关于设置遮罩层宽度有关问题

关于设置遮罩层宽度问题
做网页遮罩层时,

窗口resize事件中重新设置遮罩层宽度

var newWidth = Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth);

发现在ie下,document.documentElement.scrollWidth把我的遮罩层宽度也算在内了

造成窗口由最大化缩小时,遮罩层宽度没有跟着缩小而出现水平滚动条,但chorm下没这个问题

请教高手怎么解决这个问题??
resize 遮罩层

------解决方案--------------------
直接用 document.documentElement.clientWidth
------解决方案--------------------
function getClientWidth()
    { 
       return (navigator.userAgent.toLowerCase().indexOf("opera") != -1)?document.body.clientWidth:document.documentElement.clientWidth;  
    };
------解决方案--------------------
width:100%
不就行了?