resize function in addEventListener JS 1

resize function in addEventListener JS

window.addEventListener('resize', function(event) {
    ...
}, true);

Here is what the above code is Doing:
1. We’re adding an event listener to the window object.
2. The event listener is listening for the resize event.
3. When the resize event occurs, the function will be called.
4. The function will be called with the event object as an argument.
5. The function will be called in the capture phase.

Similar Posts