Sunday, September 17, 2006

Fun With Javascript

Here's a fun little script my dad found:

javascript:X=[R=(s=(m=Math).sin)(0),.1,.25,1.6,300,300];c=m.cos;Y=[0,.05
,.24,.24,200,200];D=document.images;setInterval(function(){for(i=0;i<D.leng
th;i++){S=D[i].style;S.position=\'absolute\';S.left=s(R*X[1]+i*X[2]+X[3])*X[4]
+X[5];S.top=c(R*Y[1]+i*Y[2]+Y[3])*Y[4]+Y[5]}R++},5);void(0)


Simply paste the code into your browser's address bar while you are viewing any web page that has images, and Voila! All the images start flying around the screen. Neat.

All that from a four-line script. Says something about the power of Java, doesn't it?

Note: The above script was found on the OT-Windows newsgroup and made blog-friendly using Quick Escape. Gotta give credit where credit is due...

No comments: