我一直在研究這個了幾天,我卡住了...我看到這個頁面的內容:調整大小的iframe高度時,iframe的變化(同一域)
Resizing an iframe based on content
與此頁:
Auto resize iframe height when the height of the iframe contents change (same domain)
看來這是比較容易調整的iframe當包含I幀首次加載,但緬因州的index.html一次的iframe更改的內容我無法弄清楚如何重新 - 大小e iframe。
我的index.html:
<body>
<iframe seamless frameborder="0" name="top" id="top" src="venues.php" width="100%" height="100" /></iframe>
<iframe seamless frameborder="0" name="main" id="main" src="admin.php" width="100%" height="2000" /></iframe>
當venues.php負荷是100像素(這是罰款),但是當在(內部,同一個域)的venues.php內部鏈接有人clisk頁面我需要調整「頂部」框架高度以適應新的內容。
我試過一堆解決方案,我總是隻能在第一次加載時調整大小,而不是當有人在裏面點擊時調整大小。
感謝
我已經解決了在框架中使用JS向容器中的JS發送消息。該消息說明框架需要多大,容器中的JS比調整控件大小。 – Richard
你能告訴我一個例子,或者至少告訴我你是如何發送消息到容器?我在印象中(從我閱讀過的其中一個鏈接中看到的東西)你無法通過孩子與父母進行溝通 – marcnyc
你有沒有看過: - http://stackoverflow.com/questions/12082125/resize-iframe -on-content-refresh-or-update –