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) ;
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn