- iframe高度设置为子页面高度
//需要使用Jquery $(document).ready(function () { parent.document.getElementById("ifPage").style.height = document.body.scrollHeight + "px"; }); |
- iframe高度自适应于父页面
//需要使用Jquery $(window).resize(function () { var webheight = document.body.clientHeight - X; //X是需要减去的高度量,例如顶部导航的高度 $("#ifPage").attr("style", "height:" + webheight + "px;"); $(window).load(function () { var webheight = document.body.clientHeight - 105; |
- 父子页面间传递元素
父页面获取子页面中的数据,JS代码:
|
- 刷新父页面
JS代码: function parentReload() { window.parent.location.reload();} |
- 重新加载子页面
C#代码: iframe.Attributes[ "Src"] = "ItemTQEditorPage.aspx"; |