Home > jQuery > How to Get the Size of the Viewport Using jQuery
Bookmark and Share

How to Get the Size of the Viewport Using jQuery

Posted on March 31, 2018 | Filed in jQuery

Sometimes you will need to get the width and height of a window. To do that, you would use

jQuery(window).width();
jQuery(window).height();

This is useful on page load, if you wanted to check when a window was resized, you would use:

jQuery(window).resize(function() {
// Code here
});

Leave a Reply

Contact Us

Big Apple Design Group
134 West 29th Street
Third Floor
New York, NY 10001

[email protected]

Search Blog