2014-01-22 55 views
0

我一直在試圖使用Crafty.js建立一個遊戲。我有一個圖像作爲一個按鈕,一旦用戶點擊它,他將被引導到下一頁。但是,由於某種原因,鼠標點擊不會觸發。有任何想法嗎?鼠標點擊不會觸發事件與Crafty.js

Crafty.scene('Main', function() { 
    Crafty.background("url('images/homeBackground.jpg')"); 
    Crafty.e('2D, DOM, Mouse, next').attr({ //next is the image 
    x: 600, 
    y: 600, 
    w: 100, 
    h: 50 
    }).bind('click', function (e) { 
    alert("Here?"); //this isn't firing 
    }); 
}); 

回答