Javascript Done Resize

Normally code in the resize event is meant to just run once when the user is done resizing.  This code below, from css-tricks and seen elsewhere will do the trick:

var resizeTimer;
$(window).on('resize', function(e) {
resizeTimer = setTimeout(function() {
// Run code here, resizing has "stopped"
}, 250);

Tagged with:

Leave a Reply

Your email address will not be published. Required fields are marked *