摘要:
iframe高度自适应
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 = c 阅读全文
posted @ 2013-09-24 00:25
mengyuxuan
阅读(342)
评论(0)
推荐(0)
浙公网安备 33010602011771号