---
title: "iframe 高度宽度自动控制 父窗口调用"
author: "foolraty"
date: "2010-05-25T13:52:30Z"
tags: []
categories: ["Web前端"]
slug: "iframe"
draft: false
lastmod: "2010-05-25T13:52:30Z"
id: 674925
url: "https://foolraty.iteye.com/blog/674925"
---

高度
<iframe name="myframe" src="myframe.htm" frameborder="0" scrolling="auto" width="100%" height="100%" onload="document.all.style.height=myframe.document.body.scrollHeight" ></iframe> 

宽度
<iframe name="myframe" src="myframe.htm" frameborder="0" scrolling="auto" width="100%" height="100%" onload="document.all.style.width=myframe.document.body.scrollWidth" ></iframe>

父窗调用
parent.document
parent.location