2019【西游手游】一键服务端+安卓端+...
搭建源码
简洁小清新个人Typecho情侣主题Cupid...
dedecms织梦想在一行显示多个标题:比...
关于WordPress-防止恶意评论代码处理...
织梦DedeCMS/.幻灯片调用图片显示模糊...
Ecshop使用支付宝支付成功后提示-此支...
上传临时目录权限不够=解决wordpress...
Python基础班13天入门课程
zblog分页条中的上下分页调用 教材来...
在ECSHOP商品搜索页显示商品货号的方...
0x01 iframe的跳出框架
0x02 iframe样式设置
0x03 iframe重置高度
1、首先来一个,跳出iframe的好方法,直接可以在Login.aspx页面使用。
if (window.parent.[IFRAME外壳的某方法]) {top.location.href = "Login.aspx";}2、再来段比较好看的iframe
<script type="text/javascript">function SetWinHeight() { var obj = document.getElementById("content"); var win = obj; if (win && !window.opera) { if (win.contentDocument && win.contentDocument.body.offsetHeight) win.height = win.contentDocument.body.offsetHeight + 20; else if (win.Document && win.Document.body.scrollHeight) win.height = win.Document.body.scrollHeight + 20; }}window.onresize = function () { SetWinHeight();}</script><div class="page-body"><iframe id="content" src="None.aspx" name="content" onload="javascript:SetWinHeight()" frameborder="0" scrolling="auto" style="min-height: 700px;" height="100%" width="100%"></iframe></div>3、子页面的使用,子页面,在调整大小后,可以调用父页面的SetWinHeight就可用把布局弄好看了。
if (window.parent.SetWinHeight) window.parent.SetWinHeight();以上所述是小编给大家介绍的Html之 IFrame使用及注意点,希望对大家有所帮助,
