Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK - Notts
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Layer resize problem..

    I have the following JS function which onload checks the size of two divs that are side by side, and resizes the smaller one to the same size as the larger div, so that they appear to be the same height.


    function resizeDiv(){
    var focusHT = document.getElementById("focus").offsetHeight;
    var thesHT = document.getElementById("thes").offsetHeight;
    if(focusHT < thesHT){
    document.getElementById("focus").style.height = thesHT-20;
    }else if(focusHT > thesHT){
    document.getElementById("thes").style.height = focusHT-20;
    }
    }


    ...which works fine in IE. My question is - what attributes should I be using instead of offsetHeight to intially read the height of each div in netscape/mozilla? I also tried replacing offsetHeight with height and clientHeight, but that didnt work either...

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this link

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Location
    UK - Notts
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope, that wasnt useful I tried most ways and still cant emplement it right, any help with the script, any one get this working? please if you could, muchly appreciated

    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •