How do I add a simple onClick event handler to a canvas element?

前端 未结 7 1687
自闭症患者
自闭症患者 2020-11-22 09:07

I\'m an experienced Java programmer but am looking at some JavaScript/HTML5 stuff for the first time in about a decade. I\'m completely stumped on what should be the simple

7条回答
  •  长发绾君心
    2020-11-22 09:54

    As another cheap alternative on somewhat static canvas, using an overlaying img element with a usemap definition is quick and dirty. Works especially well on polygon based canvas elements like a pie chart.

提交回复
热议问题