需要
执行项目的前端页面。页面不在倒计时
操作,下面是前端代码。
设置(倒计时
功能开关)
无功_mouseactivelistener_flag =真;
beforecount:触发器的间隔(单位:毫秒)
计数:倒计时总数(单位:秒)
无功mouseactivelistener =功能(beforecount、计数、回调){
无功__countdown_html =;
定义
VaR
目标= null,_t = null,_tc = null;
无功target_countdown =功能(__count){
如果(__count > = 0){
target.innerhtml = __count +秒后';
_tc = setTimeout(){()
函数(
target_countdown(__count);
},1000);
{人}
回调();
}
__count --;
},_t_exec =函数(){(){
setTimeout()函数返回((){
如果(_mouseactivelistener_flag){
目标= ne.dom.createel(__countdown_html);
document.body.appendchild(目标);
target_countdown(计数);
}
},beforecount);
},_t_clear =函数(){(){
ClearTimeout(_t);
ClearTimeout(_tc);
/ / target.parentelement.removechild(目标);
$(目标);
目标= null;
};
_t = _t_exec();
Document.addEventListener(听到咔哒声,函数(){(){
_t_clear();
_t = _t_exec();
});
};
操作说明:在5秒(5000)不触发的
情况下进行倒计时,倒计时180秒,具体功能为查看代码。
mouseactivelistener(5000, 180,函数()){
window.location.href = /家/指数;
});
以上是本文的全部内容,希望能对您有所帮助,希望大家多多
支持。