]> git.parisson.com Git - mezzo.git/commitdiff
Throttle the window resize event for better performances
authorJérémy Fabre <blackmagik88@gmail.com>
Thu, 21 Jul 2016 10:15:19 +0000 (12:15 +0200)
committerJérémy Fabre <blackmagik88@gmail.com>
Thu, 21 Jul 2016 10:15:19 +0000 (12:15 +0200)
app/static/src/js/modules/sticky-kit-init.js

index 8521305011197115e3680e569d51bbaae35972f5..55d7af53be04a23aa802771306b61bd9f27e02e1 100644 (file)
@@ -38,7 +38,7 @@ StickyKitInit.prototype.init = function() {
 
     });
 
-    $(window).resize(that.windowResize.bind(that));
+    $(window).resize( $.throttle(1000, that.windowResize.bind(that)) );
 
 };