Skip to content

Instantly share code, notes, and snippets.

@marcelofabianov
Created August 8, 2013 11:38
Show Gist options
  • Save marcelofabianov/6183885 to your computer and use it in GitHub Desktop.
Save marcelofabianov/6183885 to your computer and use it in GitHub Desktop.

Revisions

  1. marcelofabianov created this gist Aug 8, 2013.
    11 changes: 11 additions & 0 deletions teste
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function throttle( fn, time ) {
    var t = 0;
    return function() {
    var args = arguments, ctx = this;
    clearTimeout(t);

    t = setTimeout( function() {
    fn.apply( ctx, args );
    }, time );
    };
    }