This post will discuss how to trigger a window resize event in JavaScript and jQuery.

1. Using jQuery

In jQuery, you can trigger the window resize event using the .trigger() method.

Edit in JSFiddle

2. Using JavaScript

In pure JavaScript, you can trigger the resize event using window.dispatchEvent() method:

Edit in JSFiddle

 
Alternatively, you can use the window.resizeTo() to trigger the resize event.

That’s all about triggering the window’s resize event in JavaScript and jQuery.