Jquery Resize: how to check if a screen has been resized at any point

111 views Asked by At

I'm using the jQuery .resize() event listener, and understand how to use it to trigger an action whenever the screen is re-sized. However, I'm wondering if there is a way in jQuery to allow one not just to listen for when a screen is re-sized, but to check whether or not a screen has been re-sized at all over the course of a user's session.

1

There are 1 answers

0
Sabrina On BEST ANSWER

For a simple approach you could log the initial viewport dimensions and compare them later. $(window).width(); and $(window).height(); will give you the dimensions.