function $(id) {
return typeof id === "string" ? document.getElementById(id) : id;
}
return typeof id === "string" ? document.getElementById(id) : id;
}
2017-05-16
老師提供的代碼,看評論都說有bug,也確實發(fā)現(xiàn)了,如果快速多次點擊按鈕,秒數(shù)速度會變得非常快,在開始定時器之前,先清除定時器 clearInterval(timer); 就好了
2017-05-15
最新回答 / 洛洛
因為這個id作為形參的是時候本來就是string屬性所以不用帶,但是寫notice-tit這種的時候是一個字符串所以需要帶,至于你為什么alert不出來,我自己試了一下是可以的,可能你html里的類名沒寫對
2017-05-15
媽賣批哦,send.disabled="false"是不存在的,disabled只有disabled和true這兩個屬性,想解除禁用就要removeAttribute("disabled")
2017-05-11
媽賣批哦,send.disabled="false"是不存在的,disabled只有disabled和true這兩個屬性,想接觸禁用就要removeattribute("disabled")
2017-05-11
最新回答 / 慕粉1554206971
wrap.onmouseout=auto; ? 這里是當(dāng)鼠標(biāo)移出容器時恢復(fù)自動播放,wrap.onmouseout=function() {timer=setInterval(autoPlay,1000);}這是我的寫法,至于這里為什么用auto就不清楚了
2017-05-11
最新回答 / 食夢者3711585
window.onload=function(){ ? ? ? ? // 將所有點擊的標(biāo)題和要顯示隱藏的列表取出來? ? ? ? var titls=document.getElementById("menu").getElementsByTagName("p");? ? ? ? var uls=document.getElementById("menu").getElementsByTagName("ul");? ? ? ? // 遍歷所有要點擊的標(biāo)題且給它們添加索引及綁定事件 ? ?if(titls...
2017-05-10