Posted By

kodomonster on 03/15/11


Tagged

iframe resize scrollbar no


Versions (?)

Resize Iframe Height with Javascript


 / Published in: JavaScript
 

Resize iframe height. This means if the content of your iframe is longer than the iframe height, and the iframe doesn't have a scrollbar, you can resize the height of the iframe so the content is viewed.

  1. //set the document domain
  2. document.domain = 'xxxx.com';
  3.  
  4. //resize the iframe
  5. function parent_resize()
  6. {
  7. parent.resize_iframe("idofiframe", document.getElementById('wrapper').offsetHeight);
  8. }
  9.  
  10. <body onload="parent_resize();">
  11. <div id="wrapper">
  12. .....
  13. </div>

Report this snippet  

You need to login to post a comment.