JQuery window resize - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

JQuery window resize

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript">
    window.onload=function(){/*from w w w  .ja v  a 2 s . c  o  m*/
var bg = $('.inner');
$(window).resize(function resizeBackground() {
    bg.height($(window).height() + 60);
    console.log(bg.height());
});
    }

      </script> 
 </head> 
 <body> 
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
  <div id="ajio" class="inner"> 
   <p> hi hello </p> 
  </div>  
 </body>
</html>

Related Tutorials