开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜