js节流
function _throttling(fn,wait,mustRun){ var time=null; var startTime= new Date() return function(){ clearTimeout(time) time=null; var endTime=new Date(); if(endTime-startTime>=mustRun){ startTime=endTime; fn(); } else{ time=setTimeout(fn,wait) } } } _throttling(resetH,50,33)