jquery iframe resizer
jQuery(function() {
sizeIFrame();
jQuery("#iframe_id").load(sizeIFrame);
});
function sizeIFrame() {
var helpFrame = jQuery("#iframe_g");
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
try {
helpFrame.height(innerDoc.body.scrollHeight + 35);
}
catch (e) {
//do nothing
}
if(document.all) {
try {
helpFrame.style.height(innerDoc.body.scrollHeight + 35);
//document.all.mainWin.style.height = h;
}
catch (e) {
//do nothing
}
}
}
Comentarii
Trimiteți un comentariu