最新回答 / Lzzzzzzzz_M
?沒有小三角是因為他的css里面#divselect cite{width:150px; height:24px;line-height:24px; display:block; color:#807a62; cursor:pointer;font-style:normal;padding-left:4px; padding-right:30px; border:1px solid #333333;?background:url(xjt.png) no-repeat right center;}?back...
2015-11-04
已采納回答 / Y_du
<...code...>window.onload=function(){ 這個function少了個},在addEvent(close,"click",hideLogin);之后加上就好了。
2015-11-04
鍵盤事件,把timeCounter當成老師用的flag,如果timeCounter==null就開始抽獎,如果不為null就停止抽獎
document.onkeyup = function(event){
var event = event || window.event;
console.log(event.keyCode);
if(event.keyCode == 13){
if(timeCounter){
stopFn();
}else{
playFn();
}
}
}
在stopFn()中添加一句:timeCounter = null;即可
document.onkeyup = function(event){
var event = event || window.event;
console.log(event.keyCode);
if(event.keyCode == 13){
if(timeCounter){
stopFn();
}else{
playFn();
}
}
}
在stopFn()中添加一句:timeCounter = null;即可
2015-11-03
改進了一下代碼,使得鼠標點擊與回車能混合使用,也就是鼠標點擊開始后,按下回車也會停止;按下回車開始后,點擊停止按鈕也會停止。還有,舍棄了flag變量,通過判斷timeCounter(也就是老師的timer)是否為null,來判斷是否開始或停止。關鍵代碼如下:
//鍵盤事件,把timeCounter當成老師用的flag,如果timeCounter==null就開始抽獎,如果timeCounter!=null就停止抽獎,字數限制代碼發下下一樓
//鍵盤事件,把timeCounter當成老師用的flag,如果timeCounter==null就開始抽獎,如果timeCounter!=null就停止抽獎,字數限制代碼發下下一樓
2015-11-03