iframe resize
iframe resize
Hi,
I want to resize an iframe using jquery.
Somehow the belwo code is not owrking properly for me.
Can someone help me
function sizeIFrame() {
var helpFrame = jQuery("#helpFrame");
alert(helpFrame)
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get
(0).contentDocument : helpFrame.get(0).contentWindow.document;
alert(innerDoc)
alert(innerDoc.body.scrollHeight)
helpFrame.height(innerDoc.body.scrollHeight + 35);
}
jQuery(function() {
sizeIFrame();
jQuery("#helpFrame").load(sizeIFrame);
});
</script>
<iframe id="helpFrame" name="helpFrame" marginwidth="0"
marginheight="0"
src="Index.tml" frameborder="0"></iframe>
Thanks