computing cross-browser iframe height
one many challenging problems javascript trust repremand (that "cross-browser") computing iframe height.
in applications i have lot boldly generated iframe i wish arrange autoresize during finish bucket eventuality adjust tallness width.
in box height computing best fortitude following (with assistance jquery):
function getdocumentheight(doc) {
var mdoc = doc || document;
(mdoc.compatmode=='css1compat') {
relapse mdoc.body.offsetheight;
}
else {
($.browser.msie)
relapse mdoc.body.scrollheight;
else
relapse math.max($(mdoc).height(), $(mdoc.body).height());
}
}
i searched internet but success. i also tested yahoo library methods request viewport dimensions, nonetheless it's satisfactory.
my fortitude works decently, nonetheless infrequently calculates taller height.
i've difficult tested tons properties per request tallness firefox/ie/safari: documentelement.clientheight, documentelement.offsetheight, documentelement.scrollheight, body.offsetheight, body.scrollheight, ...
also jquery doesn't have awake function several browser calls $(document.body).height(), $('html', doc).height(), $(window).height()
i above duty wholly during finish bucket event, nonetheless also box boldly extrinsic dom elements elements dark shown. box infrequently breaks formula works wholly bucket event.
does someone have genuine cross-browser (at slightest firefox/ie/safari) solution? tips hints?
Comments
Post a Comment