遊戲非常簡單,你點擊開始按鈕開始,然後沿着軌道移動你的鼠標,直到你到達結尾,然後計時器停止並顯示你的分數。如果你走出軌道,你會得到零分。爲什麼我的mouseOver功能不起作用?
爲什麼我的mouseOver功能不起作用? 鏈接到我的完整代碼:http://www.codecademy.com/TictacTactic/codebits/AQBK4L/edit
謝謝你提前!
var score = 1000;
var timer = setInterval(countDown(), 1000);
$(document).ready(function() {
$('#start').click(function() {
$('#game').mouseover(function() {
stopTimer();
score = 0
$('#points').html(score)
});
$('#end').mouseover(function() {
stopTimer()
$('#points').html(score)
});
});
});
function countDown() {
score = score - 1;
}
function stopTimer() {
clearInterval(timer);
}
'mouseOver!= mouseover',存在這個問題。 – elclanrs
爲什麼人們不會發布相關的代碼? – Jai
謝謝你的幫助。我是新來的。 – user3786992