好玩的Js

2011-03-19 00:10:47 +08:00
 Leo
标题要够短
http://balldroppings.com/js/
4791 次点击
所在节点    分享发现
6 条回复
lamengao
2011-03-19 00:22:23 +08:00
Cool!
1212e
2011-03-19 00:28:19 +08:00
画了张蜘蛛网,看一堆小球在里面狂抖 哈哈哈
wxl24life
2011-03-19 00:40:54 +08:00
so nice!
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()};
Leo
2011-03-19 14:34:48 +08:00
嘗試下離出口足夠近的位置畫一橫線,製造的聲音似乎還蠻好聽的
Kenyth
2011-03-19 14:41:42 +08:00
这个好玩 :-)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/10024

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX