Hello 我需要做的是当我点击画布外的图像时调用一个javascript函数在HTML5画布上绘制一些东西。input type =“image”and input type =“button”to draw in html5 canvas,the button is working,but I need the image to working
当我使用一个按钮来做到这一点,它工作正常
<input type="button" id="xxx" onclick="draw()"/>
但是当我使用的图像
<input type="image" id="xxx" onclick="draw()" src="file/sw1.gif"/>
的问题是,当我点击图像它会打开一个新页面的东西看起来像 index.html?x=89&y=8
问题是我怎样才能使图像行为就像按钮,而无需打开新的页面? 谢谢
更好地使用不透明度为0的图像和绝对定位输入 – 2013-07-24 19:03:23