jQuery resize event | How to use window resize() method of jQuery with window resize event

jQuery resize

The resize event happens as browser window is resized. This is useful for many situations like adjusting page elements depending on window size in order to avoid scroll bars (if required) etc.

As resize event occurs, resize() method is used to perform desired actions to associate with it.

Syntax

$(window).resize(function)

 

Example of using resize method()

This example will show an alert as window is resized (the browser viewport).

Experience this example online




Was this article helpful?

Related Articles

Leave A Comment?