Compatible with the Iframe adaptive height of mainstream browsers, the js script is as follows:
//iframe height adaptive
function iframeAutoFit(iframeObj) {
setTimeout(function () {
if (!iframeObj) return;
iframeObj.height = (iframeObj.Document ? iframeObj. Document.body.scrollHeight : iframeObj.contentDocument.body.offsetHeight);
}, 200);
} < /span>
Call method:
Extension:
//Dynamicly add styles
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) ;
}