dynamic frame row height based on content

Discussion in 'JavaScript' started by DionDev, Apr 2, 2009.

  1. #1
    Trying to get this code to work:

    
    <script type=”text/javascript”>
    function resizeframe() 
    {
      var ff = parent.document.getElementById ? parent.document.getElementById('formframe') : parent.document.all['formframe'];
      var fc = ff.contentDocument ? ff.contentDocument : document.frames('formframe').document;
      var sf = parent.document.getElementById('shoutframe');
      
      sf.rows = fc.body.offsetHeight + ", *";
    }
    </script>
    
    <frameset id="shoutframe" onload="resizeframe();">
      <frame id="formframe" src="shoutform.php" frameborder="0" scrolling="no">
      <frame src="shoutdiv.php" frameborder="0" scrolling="auto">
    </frameset>
    
    Code (markup):
    As you can see, all I want it to do is set the frame row's height based on its content.
     
    DionDev, Apr 2, 2009 IP