Events in elements within a canvas

前端 未结 3 1618
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 13:37

I\'ve draw an image inside a canvas tag. How could I add events to it? I want to do something when user clicks in that image.

character.addEventListener(\'cl         


        
3条回答
  •  醉话见心
    2021-01-15 14:24

    See blow link,there is a sample

    http://www.html5canvastutorials.com/cookbook/ch6/1369_06_03/

    See the source of page

提交回复
热议问题