Suggestion auto height when content in frame changes
-
I use this script:
<script language="javascript" type="text/javascript"> function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px'; } </script>
As you can see the above is a function that resizes based on frame but it doesn’t work that well in chrome, sometimes works sometimes doesn’t.
In firefox seems to work right.
[iframe id="frmid" frameborder="0" padding="0" margin="0" onload="javascript:resizeIframe(this); window.parent.parent.scrollTo(0,0);" src="https://mywebsite.com" scrolling="no"]
With the above I load the function each time… and it goes back to top otherwise it stays at bottom without the parent.scrollTo(0,0)
Mind implementing something like this automatically?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Suggestion auto height when content in frame changes’ is closed to new replies.