-
Notifications
You must be signed in to change notification settings - Fork 0
Js获取Iframe页面高度,并将高度赋值给Iframe #2
Copy link
Copy link
Open
Description
JQqingFirst
opened on Mar 28, 2017
Issue body actions
<iframe src="default.html" id="mainweb" name="mainweb" width="100%" height="100%" frameborder="0" onLoad="iFrameHeight()" ></iframe>
<script type="text/javascript" language="javascript">
function iFrameHeight() {
var ifm= document.getElementById("mainweb");
var subWeb = document.frames ? document.frames["mainweb"].document :
ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
</script>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels