Javascript 鼠标点击不';t使用Crafty.js触发事件
我一直在尝试使用Crafty.js构建一个游戏。我有一个图像,作为一个按钮,一旦用户点击它,他将被引导到下一页。然而,由于某些原因,鼠标点击并没有触发。有什么想法吗Javascript 鼠标点击不';t使用Crafty.js触发事件,javascript,mouseclick-event,craftyjs,Javascript,Mouseclick Event,Craftyjs,我一直在尝试使用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,
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
});
});
事件名称区分大小写,您应该绑定到
单击事件
更多详细信息,请访问:事件名称区分大小写,您应该绑定到单击事件
详情请浏览: