The IFRAME self -adaptation height compatible with the mainstream browser, the JS script is as follows:
Copy code code as follows:
// Iframe highly adaptive
Function iframeaultofit (iframeobj) {
settimeout (function () {
if (! Iframeobj) Return;
iframeObj.height = (iframeobj.documen? Iframeobj.document.body.scrollheight: iframeObj.ContentDocument.ofFSetheightheightheightheightheighHt)
}, 200);
} <span style = "font-family: arial, helvetica, sans-service;"> </span>
Calling method:
Copy code code as follows:
<iframe id = "hqright" name = "hqright" online = "javascript: iframeautofit (this);"
height = "235px;" Frameborder = "0" Scrolling = "NO"
src = "market/hqdata_page.aspx? T = TJS"> </iframe>
Extension:
Copy code code as follows:
// Dynamic adding style
function addsheetfile (obj, path) {
ifj == 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);
}