Quantcast
Channel: Resizing an iframe based on content - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by webd3sign for Resizing an iframe based on content

$
0
0
<html><head><script>function frameSize(id){var frameHeight;document.getElementById(id).height=0 +"px";if(document.getElementById){    newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;    }document.getElementById(id).height= (frameHeight) +"px";}</script></head><body><iframe id="frame"  src="startframe.html" frameborder="0" marginheight="0" hspace=20     width="100%"onload="javascript:frameSize('frame');"><p>This will work, but you need to host it on an http server, you can do it locally.    </p></body></html>

Viewing all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>