V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Leo

好玩的Js

  •  
  •   Leo · Mar 19, 2011 · 5582 views
    This topic created in 5529 days ago, the information mentioned may be changed or developed.
    6 replies    1970-01-01 08:00:00 +08:00
    lamengao
        1
    lamengao  
       Mar 19, 2011
    Cool!
    1212e
        2
    1212e  
       Mar 19, 2011
    画了张蜘蛛网,看一堆小球在里面狂抖 哈哈哈
    wxl24life
        3
    wxl24life  
       Mar 19, 2011
    so nice!
    benzhe
        4
    benzhe  
       Mar 19, 2011
    还以为说的是在地址栏玩的那种

    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
       Mar 19, 2011
    嘗試下離出口足夠近的位置畫一橫線,製造的聲音似乎還蠻好聽的
    Kenyth
        6
    Kenyth  
       Mar 19, 2011
    这个好玩 :-)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1753 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 16:19 · PVG 00:19 · LAX 09:19 · JFK 12:19
    ♥ Do have faith in what you're doing.