Compatible with the iframe adaptive height of mainstream browsers. The specific js script is as follows. If you are interested, do not miss the Iframe adaptive height compatible with mainstream browsers. The js script is as follows:
The 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 );
}
Call method:
The Code is as follows:
Extension:
The 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 );
}