📜  gistbox - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:34.043000             🧑  作者: Mango

代码示例1
function throttle( fn, time ) {
    var t = 0;
    return function() {
        var args = arguments, ctx = this;
        clearTimeout(t);

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