Javascript Cool Effect Trick

This is a really cool javascript trick that you can try out. Paste the following code into the address bar when any website with images is loaded. It is best used in uniform size pictures such as the one in Google Images.
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.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()’,50); void(0);
To stop the animation, just click on your browser’s refresh button.
Source: StopGeek
Related Posts








October 27th, 2006 at 2:26 am
[...] Cool Javascript Check out this cool Javascript trick that performs some interesting animation. Try it out for yourself! Link & Image:Hemmy.Net Tags: Javascript | Animation [...]
October 27th, 2006 at 2:47 am
Cool animation!!!!
October 27th, 2006 at 10:53 am
Totally awesome! I don’t mean to shamelessly plug my site but it does look wonderful there!
October 29th, 2006 at 8:14 am
how do you get it to work??? :s
October 29th, 2006 at 8:47 am
Just copy and paste the code into your address bar (the one where you type your url such as http://www.google.com)
October 30th, 2006 at 9:23 am
Really nice.
June 15th, 2007 at 5:34 pm
[...] it’s just a bit of fun, however, it’s still quite cool. I found a piece of code HEMMY.NET that produces a really nice affect when pasting the following JavaScript into the URL bar whilst [...]
July 6th, 2007 at 1:47 am
doesn’t work in IE
July 27th, 2007 at 2:07 pm
Try this (copy the code below and paste it on your internet address bar or URL and hit enter):
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.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()’,10); void(0);
Hint: Use google image to search for any images.
December 15th, 2007 at 11:21 pm
Didnt make it to work with the latest Explorer and Firefox reader.But,maybe i did something wrong?.
March 13th, 2008 at 12:33 pm
This version works in IE:
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; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval(’A()’,5); void(0);
simply copy (ctrl + C), press Alt + D, ctrl + V, then enter.
the moving images will be at the top of the page.
Note: this dosnt effect the internet! it only effects what YOU see!
October 11th, 2008 at 8:22 am
I have Firefox 3 and i cant get this to work. Any ideas?
October 21st, 2008 at 11:18 am
i have firefox 3 too and i can’t press enter once i pasted the code.
May 14th, 2009 at 10:15 pm
kewl!
and I’ve just modified the script for ff3 and ie8.
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; setInterval(function(){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++},5);
July 22nd, 2009 at 6:21 pm
hey.. u can also change d numbers in it… like.. 200 to 20 or 40…or sin to cos or to tan etc.. n see more different effects..
its interesting..
October 31st, 2009 at 3:31 am
Cool! Thanks for sharing.