From: Jérémy Fabre Date: Thu, 21 Jul 2016 10:15:19 +0000 (+0200) Subject: Throttle the window resize event for better performances X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=df070b2990521de3dc3e1413954278b84beed60c;p=mezzo.git Throttle the window resize event for better performances --- diff --git a/app/static/src/js/modules/sticky-kit-init.js b/app/static/src/js/modules/sticky-kit-init.js index 85213050..55d7af53 100644 --- a/app/static/src/js/modules/sticky-kit-init.js +++ b/app/static/src/js/modules/sticky-kit-init.js @@ -38,7 +38,7 @@ StickyKitInit.prototype.init = function() { }); - $(window).resize(that.windowResize.bind(that)); + $(window).resize( $.throttle(1000, that.windowResize.bind(that)) ); };