I have an iframe on a site that I'm building. Problem is, one of the pages I display inside the frame has some dynamic content (that expands and decreases in height when clicked), is there a way for the iframe to resize along with its content too?
It loads the size of the static page but once the item on page has been clicked and expands, the iframe doesn't expand with it.
I just have it basic at the moment, here is my <head>
content:
<script language="javascript" type="text/javascript">
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
</script>
And this is my iframe:
<iframe src="index2.php" name="frame" frameborder="0" scrolling="no" onload="resizeIframe(this)" />