Mzone. createObject ("mzone. cc. iframe "); /** * Desc: defines the static method of the object mzone. cc. iframe to realize dynamic iframe adjustment. * Para: iframe-the iframe object to be adjusted, DOM object * ExtHeight-automatically calculates the height of an iframe and then adds an additional height value, number type * MinHeight-minimum height of iframe, numeric type * Return: No Return Value */ Mzone. cc. iframe. autoHeight = function (/* object */iframe,/* int */extHeight,/* int */minHeight ){ Iframe. style. display = "block "; If (iframe. contentDocument & iframe. contentDocument. body. offsetHeight) {// ff, chrome, etc. Var h = parseInt (iframe. contentDocument. body. offsetHeight) + 50; H + = extHeight; If (h <minHeight) h = minHeight; Iframe. height = h + "px "; } Else if (iframe. Document & iframe. Document. body. scrollHeight) {// IE Var h = parseInt (iframe. Document. body. scrollHeight) + 35; H + = extHeight; If (h <minHeight) h = minHeight; Iframe. height = h + "px "; } Else { Var h = parseint(iframe.content?#document.doc umentElement. scrollHeight) + 35; H + = extHeight; If (h <minHeight) h = minHeight; Iframe. height = h + "px "; } } |