

UPDATE: Here's another option if you don't want to make use of any other third-party libraries. trigger('resize') to run on page load instead. Of course, you can attach your resize handler outside of the document ready handler if you want. This will cause your resize handler to trigger on window resize and on document ready. $(window).resize(myResizeFunction).trigger('resize') JavaScript/JQuery: $(window).resize how to fire AFTER the resize is completed? If you don't have underscore or lodash, you can implement a similar solution yourself: This isn't used as often with resize events, but it's worth being aware of. It "throttles" how often the code is called.

Here's an example using jQuery, javascript and css to handle resize events.
