Iframe自动增高
发布日期:2021-08-12 01:50:50 浏览次数:5 分类:技术文章

本文共 497 字,大约阅读时间需要 1 分钟。

var adjustIframe = function (id) { var iframe = document.getElementById(id) var idoc = iframe.contentWindow && iframe.contentWindow.document || iframe.contentDocument; var callback = function () { var iheight = Math.max(idoc.body.scrollHeight, idoc.documentElement.scrollHeight); //取得其高 iframe.style.height = iheight + "px"; } if (iframe.attachEvent) { iframe.attachEvent("onload", callback); } else { iframe.onload = callback } }

转载于:https://www.cnblogs.com/ooyiye/archive/2011/01/19/1939559.html

转载地址:https://blog.csdn.net/weixin_30642305/article/details/96013082 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:log4net为什么会打印两次?
下一篇:Ubuntu 下开启远程连接 MySQL

发表评论

最新留言

不错!
[***.144.177.141]2024年03月27日 17时20分19秒