Created
May 24, 2016 11:40
-
-
Save avil13/9e99b40ed156236fbd77e434eb948acf to your computer and use it in GitHub Desktop.
Revisions
-
avil13 created this gist
May 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // Для вызова функции не чаще чем в указанный интервал времени var my_debounce = function(func, wait) { var timeout; return function() { var context = this, args = arguments, later = function() { timeout = null; func.apply(context, args); }; if (!timeout) { timeout = setTimeout(later, wait); } return timeout; }; };