ldsmike88 Posted March 20, 2007 Share Posted March 20, 2007 Every time I try to set the heigth of a div equal to the height of the document it freezes up. How do I make this work? Thanks! function MyWindowResized(){ var myWindowHeight = document.body.clientHeight; document.getElementById('main').style.height = myWindowHeight + 'px'; } Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted March 20, 2007 Author Share Posted March 20, 2007 Fixed it! Apparently if you use 'body' it just gets the height of the document. If you use documentElement it gets the height of the window. function windowResized(){ document.getElementById('main').style.height = document.documentElement.clientHeight - 50; document.getElementById('side').style.height = document.documentElement.clientHeight - 50; document.getElementById('main').style.width = document.body.clientWidth - 215; document.getElementById('side').style.width = 200; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.