确定Minheight并通过JavaScript。它工作成功两次,但相同的代码不能在第三次调用。这一个(document.getElementById(“rightadmin”)。style.minHeight = wrapHeight +'px';)不起作用。更令人惊讶的是,如果我让第三名升到第二名,那么它会起作用,然后第三名不起作用。所以基本上无论我在第二个之后放置什么都行不通。document.getElementById();不能第三次工作
的JavaScript:
function height(){
var dheight= ($(document).height());
var wheight= ($(window).height());
if(dheight>wheight){
var wrapHeight= dheight;
}
else {
var wrapHeight=wheight;
}
document.getElementById("iframeArea").style.minHeight=wrapHeight+'px';
document.getElementById("dailySchedule").style.minHeight=wrapHeight+'px';
document.getElementById("rightadmin").style.minHeight=wrapHeight+'px';
}
HTML:
<body onload="height();">
<!--Start of iframeArea-->
<div class="iframeArea" id="iframeArea">
<div class="btnRight" id="rightadmin">
</div>
<!--End of btnRight-->
</div>
<!--End of iframeArea-->
does element'dailySchedule' exists? – fcalderan 2012-03-22 08:14:08
whe re是dailySchedule? – 11684 2012-03-22 08:15:33
请提供完整的HTML结构 – Nishant 2012-03-22 08:15:45