確定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