Fly Images with JavaScript



Found something cool just now on Digital Point forum. You can actually make images on any website to move and fly around your screen. It’s really something cool to do - but you might feel dizzy after looking those flying images too much. So here is how you do it.

  1. Go to any website that have images on them.
  2. When you are on the website, copy and paste the code below to your address bar.

    avascript: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.getElementsByTagName("img"); 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)+’px’; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+’px’}R++}setInterval(’A()’,5); void(0);

    Example:
    jsadbar.jpg

  3. Click “Go” or push the “Enter” button on your keyboard.
  4. By then, you should see images from the website swinging here and there on your screen.

Have fun ~

Source: StopGeek via Digital Point

Candy cane Some relevant posts you might be interested:

Comments:

Post a comment