摘要: function debounce (handle,delay){ var timer = null; return function () { clearTimeout(timer) timer = setTimeout(() => { handle.apply(this, arguments) 阅读全文
posted @ 2019-03-10 17:15 那个村 阅读(121) 评论(0) 推荐(0)
摘要: function throttle(handle, wait){ var lastTime = 0; return function (){ var newTime = new Date().getTime() if(newTime - lastTime > wait){ handle.apply( 阅读全文
posted @ 2019-03-10 16:46 那个村 阅读(112) 评论(0) 推荐(0)