Javascript用光标擦除图像 [英] Javascript erase image with cursor
本文介绍了Javascript用光标擦除图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有可能使用javascript吗?
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.
但我没有找到任何可以擦除abit(光标)的任何东西(javascript明智的)位置)。
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?
推荐答案
使用html5 canvas元素。
Use html5 canvas element.
href =http://jsfiddle.net/ArtBIT/WUXDb/1/ =nofollow> http://jsfiddle.net/ArtBIT/WUXDb/1/
Checkout this fiddle for an example: http://jsfiddle.net/ArtBIT/WUXDb/1/
这篇关于Javascript用光标擦除图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文