V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Leo
V2EX  ›  分享发现

好玩的Js

  •  
  •   Leo · 2011-03-19 00:10:47 +08:00 · 4776 次点击
    这是一个创建于 4795 天前的主题,其中的信息可能已经有所发展或是发生改变。
    6 条回复    1970-01-01 08:00:00 +08:00
    lamengao
        1
    lamengao  
       2011-03-19 00:22:23 +08:00
    Cool!
    1212e
        2
    1212e  
       2011-03-19 00:28:19 +08:00
    画了张蜘蛛网,看一堆小球在里面狂抖 哈哈哈
    wxl24life
        3
    wxl24life  
       2011-03-19 00:40:54 +08:00
    so nice!
    benzhe
        4
    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
        5
    Leo  
    OP
       2011-03-19 14:34:48 +08:00
    嘗試下離出口足夠近的位置畫一橫線,製造的聲音似乎還蠻好聽的
    Kenyth
        6
    Kenyth  
       2011-03-19 14:41:42 +08:00
    这个好玩 :-)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2011 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:36 · PVG 09:36 · LAX 18:36 · JFK 21:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.