這不應該是一個問題,但我不明白爲什麼我的事件監聽器沒有觸發。我已經將我的代碼剝離到了靠近骨頭的地方,但仍然不會很好。添加一個事件監聽器到畫布
跳出來的唯一變量是我使用jQuery的jCanvas,但我懷疑這是什麼問題。
下面的代碼:
jQuery(document).ready(function(){
// Get the Canvas set to the proper size
canvas = document.getElementById("background");
canvas.width = document.width;
canvas.height = document.height;
canvasW = canvas.width;
canvasH = canvas.height;
canvas.addEventListener("mousedown", check,false);
});
function check(ev)
{
alert('click');
}
感謝您抽出寶貴時間太長看我傻難題
是的,我記得今天早上在洗澡時。我已經將導航欄移動到導航欄下方,以便我可以與兩者進行交互。謝謝你的努力! – PandemoniumSyndicate 2011-12-23 08:25:43