/ Published in: JavaScript
This Event Listener + Handler will detect the new height of the browser window.
Expand |
Embed | Plain Text
<script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ //If the User resizes the window, adjust the #container height $(window).bind("resize", resizeWindow); function resizeWindow( e ) { var newWindowHeight = $(window).height(); $("#container").css("min-height", newWindowHeight ); } }); </script>
Comments
Subscribe to comments
You need to login to post a comment.

Cheers for the snippet, $(window).bind("resize", resizeWindow); is very useful!
thanks for the snippet! Just a note, min-height may not work in some browsers...