Look directly at the effect point here (remember analog phone OH)
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <Metaname= "Viewport"content= "initial-scale=1.0, width=device-width,minimum-scale=1.0,maximum-scale=1.0, User-scalable=no" /> <title>Scratch Card</title></Head><Body><CanvasID= "Canvas"width= "+"Height= "Max"></Canvas><Script> varOcanvas=document.getElementById ('Canvas'), Aprizelist= ['Http://ued.taobao.org/blog/wp-content/themes/taobaoued/images/logo.png', 'Http://i1.sinaimg.cn/dy/deco/2013/0329/logo/LOGO_1x.png'], prizeimg=Aprizelist[math.floor (Math.random ()*Aprizelist.length)]; Scratch (Ocanvas, prizeimg,0.8, function() {alert ('end.'); }); /** * Scratch card * @param ocanvas Canvas Drawing Object * @param prizeimg winning picture * @param scale scratch area% @param c Functions performed after Allback is scraped off*/ functionScratch (Ocanvas, prizeimg, scale, callback) {if(!ocanvas.getcontext)return; varW=Ocanvas.getattribute ('width'), H=Ocanvas.getattribute ('Height'), CTX=Ocanvas.getcontext ('2d'), FN=Callback|| function(){}; //set up a prize pictureOCanvas.style.background= 'URL ('+prizeimg+') 0 0/cover no-repeat'; //draw a grey scratch areaCtx.fillstyle= "#999"; Ctx.fillrect (0,0, W, h); //set how overlapping displaysctx.globalcompositeoperation="Destination-out"; //Binding EventsOcanvas.addeventlistener ('Touchstart', function(){ //Press and SlideOcanvas.addeventlistener ('Touchmove', function(e) {e.preventdefault (); varx=e.targettouches[0].clientx+Document.body.scrollLeft-Ocanvas. offsetleft, y=e.targettouches[0].clienty+Document.body.scrollTop-Ocanvas.offsettop; Ctx.beginpath (); Ctx.arc (x, Y, the, 0, Math.PI*2); Ctx.fill (); Ctx.closepath (); }); Ocanvas.addeventlistener ('Touchend', function(e) {e.preventdefault (); varCount= 0, Datas=Ctx.getimagedata (0,0, w,h); for (varI= 0, Len=datas.data.length; I<Len; I++) { if(Datas.data[i]== 0) {Count++; } } if(Count>=Datas.data.length*Scale ) {fn (); Ctx.fillrect (0,0, w,h); } ocanvas.removeeventlistener ('Touchmove'); Ocanvas.removeeventlistener ('Touchend'); }); }); }</Script></Body></HTML>
"Memory 1314" lottery phone scratch Card