下面是主页面的内容: <script type="text/javascript"> function changeFrameHeight(){ var ifm= document.getElementById("iframepage"); ifm.height=document.body.clientHeight + 50; } window.onresize=function(){ changeFrameHeight(); } </script> <div id="tt"> <div title="首页"> <iframe src="page/home.html" id="iframepage" onload="changeFrameHeight()" style="width:100%;" scrolling="no" frameborder="0"></iframe> </div> </div>当页面缩小时,home.html内容不能全部显示出来,应该怎么更改?
1 回答
茅侃侃
TA贡献1842条经验 获得超22个赞
<script type="text/javascript">
function changeFrameHeight(){
setTimeout(function(){ var iFrameID = document.getElementById('iframepage'); if(iFrameID) {
iFrameID.height = "";
iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
}
},300)
}window.onresize=function(){
changeFrameHeight();
}</script>
添加回答
举报
0/150
提交
取消
