admin管理员组

文章数量:1313347

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.

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.

Share Improve this question asked Aug 10, 2012 at 14:07 James AndrewJames Andrew 7,24314 gold badges48 silver badges62 bronze badges 2
  • Also if there's a HTML5 alternative please tell me :) – James Andrew Commented Aug 10, 2012 at 14:08
  • 2 Something knocked up in canvas would be your best bet for this sort of thing. – Mitya Commented Aug 10, 2012 at 14:09
Add a ment  | 

2 Answers 2

Reset to default 6

Use html5 canvas element.

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

jQuery Plugin: http://www.senamion./blog/jScratchcard.html

HTML5: http://www.catchmyfame./2011/06/28/a-jquery-canvas-scratch-off/

本文标签: Javascript erase image with cursorStack Overflow