刚才的发错了。 function dochange(curindex){
for(var i=0;i<list.length;i++){
list[i].className="";
}
list[curindex].className="on";
h=-170*curindex;
pic.style.top=h+"px";
index=curindex;
}
}
for(var i=0;i<list.length;i++){
list[i].className="";
}
list[curindex].className="on";
h=-170*curindex;
pic.style.top=h+"px";
index=curindex;
}
}
2015-09-15
function dochange(curindex){
for(var i=0;i<list.length;i++){
list[i].className="";
}
list[curindex].className="on";
if(h>=-510){
h=-170*curindex;
pic.style.top=h+"px";
}else{
h=0;
pic.style.top=h+"px";
}
index=curindex;
}
for(var i=0;i<list.length;i++){
list[i].className="";
}
list[curindex].className="on";
if(h>=-510){
h=-170*curindex;
pic.style.top=h+"px";
}else{
h=0;
pic.style.top=h+"px";
}
index=curindex;
}
2015-09-15
function autoplay(){
index++
if(index>=list.length){
index=0;
}
dochange(index);
}
index++
if(index>=list.length){
index=0;
}
dochange(index);
}
2015-09-15
for(var i=0;i<list.length;i++){
list[i].id=i;
list[i].onmouseover=function(){
clearInterval(timer);
dochange(this.id);
}
list[i].onmouseout=function(){
timer=setInterval(autoplay,1000);
}
}
if(timer){
clearInterval(timer);
}
timer=setInterval(autoplay,1000);
list[i].id=i;
list[i].onmouseover=function(){
clearInterval(timer);
dochange(this.id);
}
list[i].onmouseout=function(){
timer=setInterval(autoplay,1000);
}
}
if(timer){
clearInterval(timer);
}
timer=setInterval(autoplay,1000);
2015-09-15
window.onload=function(){
var wrap=document.getElementById('wrap'),
pic=document.getElementById('pic'),
list=document.getElementById('list').getElementsByTagName('li'),
index=0,
h=0;
timer=null;
var wrap=document.getElementById('wrap'),
pic=document.getElementById('pic'),
list=document.getElementById('list').getElementsByTagName('li'),
index=0,
h=0;
timer=null;
2015-09-15
send.onclick=function(){
send.value=times+"秒后重试";
send.disabled="false";
timer=setInterval(js,1000);
}
function js(){
if(times>1){
times-=1;
send.value=times+"秒后重试";
}else{
send.value="发送验证码";
send.disabled="";
clearInterval(timer);
}
}
send.value=times+"秒后重试";
send.disabled="false";
timer=setInterval(js,1000);
}
function js(){
if(times>1){
times-=1;
send.value=times+"秒后重试";
}else{
send.value="发送验证码";
send.disabled="";
clearInterval(timer);
}
}