簡體   English   中英

根據iframe src網址的iframe內容動態調整iframe的大小

[英]Resize of Iframe dynamically depending on the content of the Iframe of the Iframe's src URL

我想根據IFrame的src URL的內容動態調整iframe的高度,並且此src通過Webservice方法來實現。

請幫助任何人..謝謝

如果網站來自同一域,則可以使用以下代碼,該代碼將盡可能擴展框架:

var frame = document.getElementById("name_of_iframe");
var contentframe = document.frames["name_of_iframe"];
contentframe = (contentframe.contentDocument||contentframe.windowWindow.document).body;
frame.style.height = contentframe.scrollsetHeight + "px";
frame.style.width = contentframe.scrollWidth + "px";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM