0
有什么方法可以改变车身高度。我试过了:更改车身尺寸高度
if(document.body.scrollHeight > document.getElementById('DIVBODY').scrollHeight) {
document.body.scrollHeight = document.getElementById('DIVBODY').scrollHeight
}
但它不起作用。 我动态地改变我的DIVBODY内容,我不希望我比div DIVBODY大。
体和DIV:
<body background="images/grey-lines.png" style="overflow-y:scroll" >
<div id="DIVBODY" style="max-width:1102px; margin: auto; width: expression(Math.min(parseInt(this.offsetWidth), 1102)); height:100%; text-align:center; align:center;
background-image: url(bg/wood-3.jpg) ; background-color:#af7746; background-attachment:fixed; background-position: top center ; background-repeat: repeat; border-left: 1px solid black; border-right: 1px solid black; height: auto; min-height: 100%; _height: 100%;">
请出示只是document.body.scrollHeight和的document.getElementById( 'DIVBODY')。scrollHeight属性之前,你的 “IF” 调试它 – clement 2012-01-11 19:13:29