La hauteur d'auto-adaptation iframe compatible avec le navigateur grand public, le script JS est le suivant:
Copier le code du code comme suit:
// iframe hautement adaptatif
Fonction iframeaultoFit (iframeObj) {
setTimeout (function () {
if (! iframeoBj) retourner;
iframeobj.height = (iframeobj.documen? iframeobj.document.body.scrollHeight: iframeobj.contentDocument.offsethehiightheightheightheighht)
}, 200);
} <span style = "Font-Family: Arial, Helvetica, Sans-Service;"> </span>
Méthode d'appel:
Copier le code du code comme suit:
<iframe id = "hqright" name = "hqRight" online = "javascript: ifraMautoFit (this);"
height = "235px;" frameborder = "0" Scrolling = "NO"
src = "Market / hqdata_page.aspx? t = tjs"> </ iframe>
Extension:
Copier le code du code comme suit:
// Style d'ajout dynamique
fonction addSheetFile (obj, path) {
ifj == Undefined ||
obj = document;
var fileref = obj.createelement ("lien")
fileref.rel = "Stylesheet";
fileref.type = "text / css";
fileref.href = path;
fileref.media = "écran";
var headobj = obj.getElementsByTagName ('Head') [0];
Headobj.ApendChild (FileRef);
}