Jump to content

canvas element


birbal

Recommended Posts

How can i determine the position cordinate on a mouseclick in a canvas element (relative to the canvas element)?any help will be appriciated.

Link to comment
Share on other sites

You could subtract the coordinates of the canvas element from the event.pageX & event.pageY properties. canvas.style.left and canvas.style.top won't work, however, if the element is being pushed around by previous elements.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...