www.webdeveloper.com
Results 1 to 9 of 9

Thread: IE6 Can't Handle This

  1. #1
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171

    IE6 Can't Handle This

    This code just won't work in IE6, it freezes up the browser everytime. Why is it doing this?

    Code:
    if ((document.body.offsetHeight - 225) < document.getElementById("navigate").offsetHeight){
    	document.getElementById("explore").style.height = (document.getElementById("navigate").offsetHeight + 225) + "px";
    }
    Why is it doing this?
    Hola!

  2. #2
    Join Date
    Apr 2009
    Posts
    48
    IE 6 doesn't understand element.offsetHeight well. You have to traverse document towards top and count offset height.

  3. #3
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171
    Well when I do the following code it works fine and gives the result it should.

    Code:
    alert((document.getElementById("navigate").offsetHeight + 225) + "px");
    Hola!

  4. #4
    Join Date
    Apr 2009
    Posts
    48
    Not getting exactly what is your problem. Can you please paste your html code where you are getting problem.

  5. #5
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171
    Here's the site.
    Hola!

  6. #6
    Join Date
    Apr 2009
    Posts
    48
    Error in your page is not because of above mentioned code. It's because of this script-
    <script type="text/javascript" src="http://www.thewebbakery.com/global/scripts/twitter.js"></script>
    you can check by removing this script from your page.

  7. #7
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171
    No that works perfectly fine. I have isolated the error through multiple tests and have come to the conclusion that is it the code I mentioned above.
    Hola!

  8. #8
    Join Date
    Apr 2009
    Posts
    48
    can you please elaborate more about how you are performing your tests?

  9. #9
    Join Date
    Mar 2008
    Location
    Gulf Breeze, Florida
    Posts
    171
    Thankyou for your help atrips but my problem is not with how I am testing. I have isolated the problem and it lies in the following code...

    Code:
    if ((document.body.offsetHeight - 225) < document.getElementById("navigate").offsetHeight){
    	document.getElementById("explore").style.height = (document.getElementById("navigate").offsetHeight + 225) + "px";
    }else{
    	document.getElementById("explore").style.height = 100 + "&#37;";
    }
    Hola!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles