简体   繁体   中英

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

I want to resize the height of Iframe dynamically on the content of the IFrame's src URL and the this src is coming through Webservice method.

please help any one..thanks

When the website is from the same domain, you can use this code, which expands the frame as much as possible:

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";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM