jQuery - resize() method
This method is a shorthand for the .on('resize', handler) or .trigger('resize').The resize event is sent to the window element when the dimension in the browser window changes.
Syntax:
Trigger the resize() method for an element:$(selector).resize()Attach a function to the resize resize event:
$(selector).resize(function)
Example:
$( window ).resize(function() {In this example, a message is concatenated to the < div id="log"> each time the window is resized.
$( "#log" ).append( "resize() method called" );
});
References:
https://www.w3schools.com/jquery/event_resize.asp
https://api.jquery.com/resize/