nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
精灵'S blog <script> <BR>var r; <BR>var a; <BR>var ai; <BR>var n; <BR>var w; <BR>var k; <BR>var inter; <BR>var period=20000; <BR>var dur; <BR>var hdur2; <BR>var hdur; <BR>var z; <BR>var nn; <BR>var donut; <BR>var time; <BR>var id = new Array(); <BR>for(i=0;i<100;i++){ <BR> id[i]=document.getElementById('ik'+i); <BR>} <br><br>function again(){ <BR> if(id){ <BR> for(i=0;i<100;i++){ <BR> id[i].style.backgroundColor='rgb(0,0,0)'; <BR> } <BR> } <BR> r=0; <BR> a=0; <BR> ai=Math.random()/5.0-0.1; <BR> n=Math.floor(Math.random()*17)+3; <BR> w=Math.floor(Math.random()*11)+1; <BR> if(n*w>100){ <BR> n=Math.floor(n/w); <BR> } <BR> k=Math.random()*2.0+0.3; <BR> if(Math.random()<0.5) k=-k; <BR> inter=1+Math.floor(Math.random()*125); <BR> dur = Math.floor(period/inter); <BR> hdur2=dur*dur/4; <BR> hdur = dur/2; <BR> z=2*Math.PI/(n*(1+Math.random()/10)); <BR> nn=Math.floor(Math.random()*n)+1; <BR> donut=Math.random()*10.0-5.0; <BR> time=0; <BR> for(i=0;i<n*w;i++){ <BR> id[i].style.backgroundColor='rgb(' <BR> +Math.round(64+Math.random()*191)+',' <BR> +Math.round(64+Math.random()*191)+',' <BR> +Math.round(64+Math.random()*191)+')'; <BR> } <BR> hey(); <BR>} <br><br><BR>function hey(){ <BR> for(i=0;i<n*w;i++){ <BR> tt=time-hdur; <BR> blah=(Math.sqrt(hdur2-tt*tt)/dur) * (donut+65*Math.cos(k*a+z*i/nn)); <BR> L=blah*Math.cos(i*z+a); <BR> T=blah*Math.sin(i*z+a); <BR> id[i].style.left=Math.round((50+L)*10)/10+'%'; <BR> id[i].style.top =Math.round((50+T)*10)/10+'%'; <BR> id[i].style.width=Math.sqrt(4+Math.floor(L*L+T*T))+"px"; <BR> id[i].style.height=Math.sqrt(4+Math.floor(L*L+T*T))+"px"; <BR> if(Math.random()<0.01){ <BR> id[i].style.backgroundColor='rgb(' <BR> +Math.round(64+Math.random()*191)+',' <BR> +Math.round(64+Math.random()*191)+',' <BR> +Math.round(64+Math.random()*191)+')'; <BR> } <BR> } <BR> a+=ai; <BR> time++; <BR> if(time<dur){ <BR> setTimeout('hey();',inter); <BR> }else{ <BR> setTimeout('again();',inter); <BR> } <BR>} <BR>again(); <BR></script>
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn