Skip to content Skip to sidebar Skip to footer

Make Clickable Region In Canvas To Change Image

Please help me: create clickable regions in the canvas below that I can assign onmousedown= events to. I know how to do this with invisible DIVs, but I think there is a more eleg

Solution 1:

The canvas element can fire events but graphical elements within the canvas cannot. To do this you'll either need to implement it yourself by detecting the position of the mouse on the canvas when it is clicked and relating the value to something in your canvas, or using one of the many canvas libraries available which will handle the detection for you.


Post a Comment for "Make Clickable Region In Canvas To Change Image"