Set div height same as window (resize on window resize)


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(function(){
  2. $(window).load(function(){ // On load
  3. $('#div').css({'height':(($(window).height()))+'px'});
  4. });
  5. $(window).resize(function(){ // On resize
  6. $('#div').css({'height':(($(window).height()))+'px'});
  7. });
  8. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.