清楚定时器清除不了 财富值92

2016-10-27 11:14发布

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);                            });                    })();                 } 
付费偷看设置
发送
2条回答

修改答案: timer记录的是定时器的一个数值,清除时是按照数值清除的,并不会将timers变为null

你确定进入了console.log?应该是永远都进不了吧

一周热门 更多>