function autochange(){ times--; if(times==0){
send.value="發(fā)送驗(yàn)證碼";
send.style.color="black";
clearInterval(timer); send.disabled=false;
}else{send.value=times+"秒后重試"; } } } }
send.value="發(fā)送驗(yàn)證碼";
send.style.color="black";
clearInterval(timer); send.disabled=false;
}else{send.value=times+"秒后重試"; } } } }
2017-04-08
<script type="text/javascript">
window.onload=function(){
var send=document.getElementById("send");
timer=null;
send.onclick=function(){
times=60;
send.disabled=true;
send.style.color="#aaa";
send.value=times+"秒后重試";
window.onload=function(){
var send=document.getElementById("send");
timer=null;
send.onclick=function(){
times=60;
send.disabled=true;
send.style.color="#aaa";
send.value=times+"秒后重試";
2017-04-08
// 鼠標(biāo)劃過(guò)整個(gè)容器時(shí)停止自動(dòng)播放
for(var i=0;i<lis.length;i++){
lis[i].onmouseover = function(){
clearInterval(timer);
}
// 鼠標(biāo)離開整個(gè)容器時(shí)繼續(xù)播放至下一張
lis[i].onmouseout = function(){
timer = setInterval(changeOption,1000);
}
}
for(var i=0;i<lis.length;i++){
lis[i].onmouseover = function(){
clearInterval(timer);
}
// 鼠標(biāo)離開整個(gè)容器時(shí)繼續(xù)播放至下一張
lis[i].onmouseout = function(){
timer = setInterval(changeOption,1000);
}
}
2017-04-05
timer = setInterval(changeOption,1000);
// 定義圖片切換函數(shù)
function changeOption(){
list[index].className ="";
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
list[index].className ="on";
}
// 定義圖片切換函數(shù)
function changeOption(){
list[index].className ="";
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
list[index].className ="on";
}
2017-04-05
超級(jí)棒的
timer = setInterval(function(){
list[index].className ="";
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
list[index].className ="on";
},1000);
timer = setInterval(function(){
list[index].className ="";
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
list[index].className ="on";
},1000);
2017-04-05
timer = setInterval(function(){
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
},1000);
index++;
if(index>=lis.length){
index = 0;
}
pic.style.top = -170*index+"px";
},1000);
2017-04-05
最新回答 / startitunderground
<...code...>function getId(id){ return ?typeof id==="string"?document.getElementById(id):id; };window.addEventListener("load",function(){ //獲取鼠標(biāo)滑過(guò)或點(diǎn)擊的標(biāo)簽和要切換的內(nèi)容的元素 var navList=getId("nav").getElementsByTa...
2017-04-04
已采納回答 / 薛定諤的量子貓
因?yàn)閠imer接收到的是setTimeout返回的一個(gè)整數(shù)類型的值,clearTimeout()是根據(jù)這個(gè)值去清除計(jì)時(shí)器,計(jì)時(shí)器清除后timer變量的值依舊不變,所以最好重新賦值為NULL;setInterval也是同樣道理
2017-04-03
學(xué)了半年感覺(jué)選項(xiàng)卡還不會(huì),我也是醉了,還天天學(xué)nodejs
2017-03-29