最新回答 / qq_混沌肆虐_0
typeof 运算符返回一个用来表示表达式的数据类型的字符串。typeof[()expression[]] ;expression 参数是需要查找类型信息的任意表达式。说明typeof 运算符把类型信息当作字符串返回。typeof 返回值有六种可能: "number," "string," "boolean," "object," "function," 和 "undefined."我也是刚学的。不过我觉得应该是我这样理解的。调用的并不是那个id。。调用的是'notice-tit'这个字符串。在函数里面。...
2015-09-16
刚才的发错了。 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);
}
}