打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
iframe自适应高度问题
         iframe加载页面自适应高度,加载不同a标签的链接时高度固定在了最长的页面高度,这怎么调整?就是第一次加载时高度是自适应的,但是点击了其他a标签后,iframe高度就变成了其中页面最长的那个页面的高度,下面有很多空白。
<a href="mine.php?id=<?php echo $a ?>" target="mainframe">矿产产量</a>	<a href="right.php?id=<?php echo $a ?>" target="mainframe">简介</a><a href="geograpyh.php?id=<?php echo $a ?>" target="mainframe">地理</a><a href="people.php?id=<?php echo $a ?>" target="mainframe">人口和社会</a><a href="goverment.php?id=<?php echo $a ?>" target="mainframe">政治</a><a href="economy.php?id=<?php echo $a ?>" target="mainframe">经济</a><a href="communication.php?id=<?php echo $a ?>" target="mainframe">通讯</a><a href="transportation.php?id=<?php echo $a ?>" target="mainframe">交通</a><a href="military.php?id=<?php echo $a ?>" target="mainframe">军事</a>	<a href="energy.php?id=<?php echo $a ?>" target="mainframe">能源</a><iframe src="right.php?id=<?php echo $a ?>" name="mainframe" id="iframepage" frameborder="0" scrolling="yes" marginheight="0" width="100%" onload="iFrameHeight()" target="_self"></iframe><script type="text/javascript" language="javascript">   function iFrameHeight() {   var ifm= document.getElementById("iframepage");   var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;   if(ifm != null && subWeb != null) {   ifm.height = subWeb.body.scrollHeight;}  }   </script>

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
php页面跳转
多层级iframe 的理解
emlog模板结构介绍
php上传图片得到路径给表单字段赋值的通用方法
iframe异步加载(点击左边菜单加载右边内容)
h5 摇一摇 iOS中输入验证码撤销弹框问题
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服