iframe自适应高度

iframe 自适应高度

孤街浪徒 提交于 2020-04-07 04:59:55
iframe 的高度自适应,常用的功能 < iframe name ="detl" id ="detl" src ="list0.html" scrolling ="no" frameborder ="0" width ="100%" height ="auto" onload ="Javascript:SetWinHeight(this)" ></ iframe > < div class ="space10" > < script type ="text/javascript" > function SetWinHeight(obj) { var win = obj; if (document.getElementById) { if (win && ! window.opera) { if (win.contentDocument && win.contentDocument.body.offsetHeight) win.height = win.contentDocument.body.offsetHeight; else if (win.Document && win.Document.body.scrollHeight) win.height = win.Document.body.scrollHeight; } } } </ script ></ div > 来源:

IFrame自适应高度

对着背影说爱祢 提交于 2020-04-07 04:54:02
原文可以访问下面连接: http://blog.csdn.net/meizz/archive/2006/03/27/639857.aspx 代码 < script type = " text/javascript " language = " javascript " > function iframeAutoFit() { try { if (window != parent) { var frame = parent.document.getElementById( " contentIframe " ); if (frame.contentWindow == window) { var h1 = 0 , h2 = 0 , d = document, dd = d.documentElement; frame.parentNode.style.height = frame.offsetHeight + " px " ; frame.style.height = " 10px " ; if (dd && dd.scrollHeight) h1 = dd.scrollHeight; if (d.body) h2 = d.body.scrollHeight; var h = Math.max(h1, h2); if (document.all) { h += 4 ; } if

iframe自适应高度?

僤鯓⒐⒋嵵緔 提交于 2019-12-21 12:07:33
1. 下载代码 jquery-auto-iframe-height 或者 下载 2. 使用demo 代码 <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < html xmlns ="http://www.w3.org/1999/xhtml" xml:lang ="en" lang ="en" > < head > < meta http-equiv ="content-type" content ="text/html; charset=utf-8" /> < title > jQuery » iFrame Sizing </ title > < link rel ="stylesheet" type ="text/css" media ="all" href ="css/master.css" /> < script type ="text/javascript" src ="js/jquery-1.4.3.min.js" ></ script > < script type ="text/javascript" src ="js/jquery.iframe-auto-height

IFRAME 自适应高度

a 夏天 提交于 2019-12-17 05:35:39
var iframehide="yes" function dyniframesize() { var dyniframe=new Array() for (i=0; i<iframeids.length; i++) { if (document.getElementById) { dyniframe[dyniframe.length] = document.getElementById(iframeids[i]); if (dyniframe[i] && !window.opera) { dyniframe[i].style.display="block" if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight; else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) dyniframe[i].height = dyniframe[i].Document.body.scrollHeight; } } if ((document.all ||