开发者

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

开发者 https://www.devze.com 2023-04-05 02:16 出处:网络
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 Webserv开发者_运维百科ice method.

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 Webserv开发者_运维百科ice 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";
0

精彩评论

暂无评论...
验证码 换一张
取 消