benzhe
2011-03-19 03:19:30 +08:00
还以为说的是在地址栏玩的那种
javascript:$("#reply_content").replaceWith('<canvas id="binggo" height="100" width="628"></canvas>');var canvas=document.getElementById("binggo"),ctx=canvas.getContext("2d");ctx.strokeStyle="#CCC";ctx.translate(314,60);var x1=0,y1=0,i=1;ctx.beginPath();ctx.moveTo(x1,y1);do{if(i>360)break;var x2=35*Math.cos(i),y2=48*Math.sin(i)/(1+0.2*Math.sin(i));i<=1?ctx.moveTo(x2,y2):ctx.lineTo(x2,y2);x1=x2;y1=y2;i++}while(1);ctx.stroke();ctx.clip();ctx.translate(-314,-60);
for(n=0;n<10;n++){ctx.save();var str="0123456789abcdef",t="#";for(j=0;j<6;j++)t+=str.charAt(Math.random()*str.length);var cx=210+Math.random()*300,cy=Math.random()*100,cr=50+Math.random()*7;ctx.fillStyle=t;ctx.beginPath();ctx.arc(cx,cy,cr,0,Math.PI*2,true);ctx.fill();ctx.restore()};