Get Browser Width and Height Excluding Toolbars and Menu Size - Javascript jQuery

Javascript examples for jQuery:Width Height

Description

Get Browser Width and Height Excluding Toolbars and Menu Size

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> 
   </head> 
   <body> 
      <input type="button" id="btn1" value="test"> 
      <script type="text/javascript">
$('#btn1').click(function(){
    console.log($(window).width());
    console.log($(window).height());
});/*from  w  w  w  .jav  a 2 s. co m*/

      </script>  
   </body>
</html>

Related Tutorials