Resize div on browser resize

Posted by danit on Stack Overflow See other posts from Stack Overflow or by danit
Published on 2010-04-27T10:19:02Z Indexed on 2010/04/27 10:23 UTC
Read the original article Hit count: 260

Filed under:

I have a <div> which I want to display full screen, but I also need to incorporate a 60px high <div> and a 10px high <div> at the top of the document. The size of the main div will need to re-size as the browser window is re-sized to keep it full screen.

<div id="div1" style="height: 60px">

</div>

<div id="div2" style="height: 10px">

</div>

<div id="fullscreen">

</div>

So:

fullscreen height = document size - (#div1 + #div2)

On re-size recalculate the above value.

© Stack Overflow or respective owner

Related posts about jQuery