Team:KIT-Kyoto/れおぽん
From 2011.igem.org
Line 6: | Line 6: | ||
<SCRIPT>var str='<font face="symbol" color="red" size=3>©</font>',num=30,scw=document.body.clientWidth-16,sch=document.body.clientHeight-16,spd=10,psx=new Array(),psy=new Array(),pss=new Array();for(i=0;i<num;i++){psx[i]=Math.floor(Math.random()*scw);psy[i]=Math.floor(Math.random()*sch);pss[i]=Math.floor(Math.random()*spd)+spd/2;document.write("<SPAN style='color:#FF0000;fontsize:16;position:absolute;top:"+psy[i]+"px;left:"+psx[i]+"px;filter:Alpha(opacity=50);'ID='TD_"+i+"'>♥</SPAN>");}function tdprg(){var bd=document.body;scw=bd.clientWidth+bd.scrollLeft;sch=bd.clientHeight+bd.scrollTop;for(i=0;i<num;i++){psy[i]+=pss[i];if(psy[i]>sch-16-pss[i]){psx[i]=Math.floor(Math.random()*(scw-16));document.getElementById("TD_"+i).style.left=psx[i]+"px";psy[i]=-16;}document.getElementById("TD_"+i).style.top=psy[i]+"px";}}setInterval("tdprg()",100);</SCRIPT> | <SCRIPT>var str='<font face="symbol" color="red" size=3>©</font>',num=30,scw=document.body.clientWidth-16,sch=document.body.clientHeight-16,spd=10,psx=new Array(),psy=new Array(),pss=new Array();for(i=0;i<num;i++){psx[i]=Math.floor(Math.random()*scw);psy[i]=Math.floor(Math.random()*sch);pss[i]=Math.floor(Math.random()*spd)+spd/2;document.write("<SPAN style='color:#FF0000;fontsize:16;position:absolute;top:"+psy[i]+"px;left:"+psx[i]+"px;filter:Alpha(opacity=50);'ID='TD_"+i+"'>♥</SPAN>");}function tdprg(){var bd=document.body;scw=bd.clientWidth+bd.scrollLeft;sch=bd.clientHeight+bd.scrollTop;for(i=0;i<num;i++){psy[i]+=pss[i];if(psy[i]>sch-16-pss[i]){psx[i]=Math.floor(Math.random()*(scw-16));document.getElementById("TD_"+i).style.left=psx[i]+"px";psy[i]=-16;}document.getElementById("TD_"+i).style.top=psy[i]+"px";}}setInterval("tdprg()",100);</SCRIPT> | ||
- | |||
- | |||
- | |||
Revision as of 15:05, 18 September 2011
♥ Aug. Lab note ♥