原型函数,功能很简单,找到时钟的id,计算数值,到达抢购时间时执行任务。
function nwt() {var str=$('#deal_expiry_timer_e3cdcd2a').text();
var out=str.match(/d+/g);console.log(out);
var h=parseInt(out[0]),m=parseInt(out[1]),s=parseInt(out[2]);
console.log(h+'#'+m+'#'+s);var calc=h*3600+m*60+s;console.log(calc);
if(calc==0){} else {console.log('wait');}
var t=setTimeout('nwt()',2000);}
nwt();
最后
以上就是还单身芹菜最近收集整理的关于一个判断抢购时间是否到达的简单的js函数的全部内容,更多相关一个判断抢购时间是否到达内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复