Run code on resize window:
$(window).bind("resize", function(){ // resizing code });
Run code on resize window with 100 milliseconds interval:
var resizeTimer = null; $(window).bind('resize', function() { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function(){ // resizing code }, 100); // adding 100 milliseconds interval for avoiding jumps });
