Click here to Skip to main content
12,689,801 members (25,261 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

4.3K views
1 bookmarked
Posted

Browsers View port Width & Height using Javascript

, 24 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
DescriptionB...

Description


Browsers Width & Height using jQuery

Code


<html>
<head>
<title>Browsers Width & Height using jQuery</title>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <script>
  $(document).ready(function () {
    var height = $(window).height();
    var width = $(window).width();
    alert("Height : " + height + " Width : " + width)
  });
  </script>
</head>
<body>
</body>
</html>

Browser Compatibility


I have tested this script in the following Web browsers:

  • Internet Explorer

  • Mozilla Firefox

  • Google Chrome

  • Safari

  • Opera


jQuery


Download Latest jQuery - http://jquery.com/[^]
jQuery Tutorial - http://www.w3schools.com/jquery/default.asp[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

thatraja
Web Developer
India India
Retired from Q/A section & Technical forums since 2014

More coming soon....

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170113.4 | Last Updated 24 Nov 2011
Article Copyright 2011 by thatraja
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid