Help Writting XHTML/CSS Script (JavaScript)

Discussion in 'JavaScript' started by iisthesloth, Aug 17, 2007.

  1. #1
    Hey guys, this has been buggin me for quite a while. I'm trying to write a simple script to make my iframe's height match my "wrapper" div's height. Any ideas? Thanks alot...

    I was thinking something like this.
    var wrapperHeight = window.document.style.wrapper.height;
    window.document.iframe = wrapperHeight;
    
    Code (markup):

     
    iisthesloth, Aug 17, 2007 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    At a point after the iframe and the div have been rendered, you could try:

    document.getElementById("The_ID_of_the_Iframe").height=document.getElementById('The_ID_of_the_div').offsetHeight;
    Code (markup):
     
    Logic Ali, Aug 18, 2007 IP