jQuery > Events

Resize event in jQuery

How to attach resize event to the browser window in jQuery?

To attach resize event to a html element, resize() method can be used.

        $(window).resize(function () {
            $("#divResize").text("Window size is: " + $(window).width());

In the above code when user resize the window then browser window width is be written inside “divResize”.

 Views: 832 | Post Order: 82

Write for us