Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 javascript 的画布中添加基本的 onclick 侦听器时遇到问题,我想为其检索 (x, y) 坐标,我将不胜感激。
谢谢你。
试试这个..
document.getElementById('canvasId').addEventListener('click',function(evt){ alert(evt.clientX + ',' + evt.clientY); },false);