http://sandbox.runjs.cn/show/...展示地址
return (function(){ timers=null; if(opts.autopay){ slider.autopay(obj,opts); } slider.clearTimers(obj,opts,timers); })() autopay:function(obj,opts){return (function () {if(opts.times&&opts.autopay){clearInterval(timers);timers==null; if(timers==null){ timers=setInterval(function () { slider._right(obj,opts); },opts.times); }else{console.log(timers);//這里返回有數值,上面明明清除了定時器 }}})(); }, clearTimers:function(obj,opts,timers){return (function () {obj.hover(function(){ // opts.autopay=false;clearInterval(timers);},function(){ // opts.autopay=true;slider.autopay(obj,opts);});})(); }