Javascript erase image with cursor

2019-02-15 07:55发布

Is it possible with javascript?

I'm trying to implement a scratchcard type thing, and I was wondering if the user could 'scratch it' with his cursor and then javascript would remove/erase the image to show the text below.

But i've not been able to find anything (javascript wise) which can erase abit (cursor location) of an image.

Does anyone have any suggestions/ideas?

Thanks.

2条回答
Juvenile、少年°
2楼-- · 2019-02-15 08:16

Use html5 canvas element.

Checkout this fiddle for an example: http://jsfiddle.net/ArtBIT/WUXDb/1/

查看更多
登录 后发表回答