make clickable region in canvas to change image

前端 未结 1 1546
失恋的感觉
失恋的感觉 2021-01-01 06:04

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 thi

相关标签:
1条回答
  • 2021-01-01 06:40

    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.

    0 讨论(0)
提交回复
热议问题