Fun with Javascript

with 4 Comments

1. Browse to a site like Amazon.

2. Enter the following into your browser address window

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin (R*x1+i*x2+x3)*x4+x5;*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);

3. Hit Enter and watch the weirdness.

4 Responses

  1. Ali

    That is too weird! Why does that happen?

  2. Peter


  3. Doc Feucht

    Far freakin’ out. Just too cool. Did you write that?

  4. Dave Feucht

    Heh, nice – it just grabs the list of images on the page and manipulates their positioning on the page using style attributes, so they swirl around.

    ah, it’s just like those wonderful sites that have banner images following your mouse all over the page! šŸ™‚

Leave a Reply