That's cool. There's a bug in it though. The fishes swim too far to the right.I made my own version of one of these when bored in school a few months back.
Scroll to the top of the page.Code:javascript:amm=20;sta=2;vri=8;stH=40;saW=screen.availWidth;fiA="<img src='http://fish.sferris.net/f3.png' />";fiB="<img src='http://fish.sferris.net/f2.png' />";poA=new Array();poB=new Array();i=0;for(i=0;i<amm;i++){poA[i]=Math.round(Math.random()*saW);ff=document.createElement("div");ff.innerHTML=fiA;ff.id="fA"+i;ff.style.position='absolute';ff.style.left=poA[i]+"px";ff.style.top=(i*stH)+"px";document.body.appendChild(ff)}for(i=0;i<amm;i++){poB[i]=Math.round(Math.random()*saW);ff=document.createElement("div");ff.innerHTML=fiB;ff.id="fB"+i;ff.style.position='absolute';ff.style.left=poB[i]+"px";ff.style.top=((i*stH)+(stH/2))+"px";document.body.appendChild(ff)}function lFi(){for(i=0;i<amm;i++){poA[i]+=(Math.random()*vri)+sta;if(poA[i]>saW)poA[i]=-100;document.getElementById("fA"+i).style.left=poA[i]+"px"}for(i=0;i<amm;i++){poB[i]-=(Math.random()*vri)+sta;if(poB[i]<-100)poB[i]=saW;document.getElementById("fB"+i).style.left=poB[i]+"px"}}lf=setInterval("lFi()",25);void(0)
Bookmarks