剛才的發錯了。 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);
}
}
想要看封裝的同學們,http://www.cnblogs.com/oksite/p/4791183.html
點擊這個網址,我封裝了老師的插件。
點擊這個網址,我封裝了老師的插件。
2015-09-08
看這個也可以收獲一些之前不太熟悉的寫法,比如這個id方法的封裝。不過tabs用 jquery講會比較簡單,而且易用性更好,希望還是多點注重實用性。
2015-09-01