Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var NAME_FILTER_THROTTLE_DELAY = 350;// ms
- function throttle(fn, delay) {
- var timer = null;
- return function () {
- var context = this, args = arguments;
- clearTimeout( timer );
- timer = setTimeout( function(){ fn.apply( context, args ); }, delay );
- };
- }
- //usage: throttle( eventHandlerName, NAME_FILTER_THROTTLE_DELAY );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement