window.onresize=function(){
document.getElementById("Main").style.width=(document.body.screenWidth>950)?"100%":"950px";
document.getElementById("Main").style.height=(document.body.screenHeight>620)?"100%":"620px";
}
document.getElementById("Main").style.width=(document.body.screenWidth>950)?"100%":"950px";
document.getElementById("Main").style.height=(document.body.screenHeight>620)?"100%":"620px";
}
IE倒是都没问题,就是非IE不行...
document.body.scrollHeight>600 倒是能正确输出了true和false
就是document.getElementById("Main").style.height一直输出100%...
我觉得你这个是关键
===>>>
if(parseInt((document.body.scrollHeight+"").replace("px",""))>620)
因为我object下面还有一个table。height是26
得>626...
document.getElementById("Main").style.width=(document.body.clientWidth<750)?"100%":"750px";
document.getElementById("Main").style.height=(document.body.clientHeight<620)?"100%":"620px";
}