問題
使用 JavaScript使得iFrame高度自動調整
解決方法
target.htm
<script language="javascript">
function reSize(){
parent.document.all.framePath.height=document.body.scrollHeight; //framePath為主頁上的id
}
window.onload=reSize;
</script>
iFframe設定如下:
<iframe frameborder="0" id="frmPath" src="target.htm" scrolling="Auto" width="100%"> </iframe>
沒有留言:
張貼留言