Compatible with the Iframe adaptive height of mainstream browsers. The js script is as follows:
Copy codeThe Code is as follows:
// Iframe highly adaptive
Function iframeAutoFit (iframeObj ){
SetTimeout (function (){
If (! IframeObj) return;
IframeObj. height = (iframeObj. Document? IframeObj. Document. body. scrollHeight: iframeObj. contentDocument. body. offsetHeight );
},200 );
} <Span style = "font-family: Arial, Helvetica, sans-serif;"> </span>
Call method:
Copy codeThe Code is as follows:
<Iframe id = "HQRight" name = "HQRight" onload = "javascript: iframeAutoFit (this );"
Height = "235px;" width = "770px" frameborder = "0" scrolling = "no"
Src = "Market/HQData_page.aspx? T = tjs "> </iframe>
Extension:
Copy codeThe Code is as follows:
// Dynamically Add a style
Function addSheetFile (obj, path ){
If (obj = undefined | obj = null)
Obj = document;
Var fileref = obj. createElement ("link ")
Fileref. rel = "stylesheet ";
Fileref. type = "text/css ";
Fileref. href = path;
Fileref. media = "screen ";
Var headobj = obj. getElementsByTagName ('head') [0];
Headobj. appendChild (fileref );
}