Try This For Some Fun
Thread Starter
Try This For Some Fun
Copy the below and paste into your address bar and hit Return.
You'll need to go to another page to stop it.
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()',5); void(O);
You'll need to go to another page to stop it.
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()',5); void(O);
Last edited by MightyGem; 3rd Nov 2006 at 01:23.
Join Date: Oct 2006
Location: EGBJ Gloucester
Age: 40
Posts: 103
Likes: 0
Received 0 Likes
on
0 Posts
It's trying to move the images no the current page around - although there's a fault in it, an additional space. This is the correct code:
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()',5); void(O);
Wow!! It works in firefox 2....that's amazing!
EDIT: ok for some reason the page is changing it when it's posted. Copy it, but on the last line change 'se tInterval' to 'setInterval' by just removing that rogue space. Then it'll work, promise.
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()',5); void(O);
Wow!! It works in firefox 2....that's amazing!
EDIT: ok for some reason the page is changing it when it's posted. Copy it, but on the last line change 'se tInterval' to 'setInterval' by just removing that rogue space. Then it'll work, promise.
Last edited by robdesbois; 2nd Nov 2006 at 08:35. Reason: Strange problem...
Too mean to buy a long personal title
Very good!
Presumably this is related to the trick that some webpages have where a string of dangly stuff (or a clock, or whatever) follows your cursor around the page?
Presumably this is related to the trick that some webpages have where a string of dangly stuff (or a clock, or whatever) follows your cursor around the page?
Join Date: Oct 2006
Location: EGBJ Gloucester
Age: 40
Posts: 103
Likes: 0
Received 0 Likes
on
0 Posts
Yes - they put some extra images on the page. At a regular interval, the images are then moved to be near the current mouse cursor position.
In this case, the script finds all images on the page, then uses some yucky trigonometry to make the circle whatever position it is . I can't really be bothered to work out the maths
In this case, the script finds all images on the page, then uses some yucky trigonometry to make the circle whatever position it is . I can't really be bothered to work out the maths
Works ok, but you'll need a page with relatively small images to get a good result. If you go to say this page and paste the string in the address bar (removing the extra space of course) you'll see what I mean.
Too mean to buy a long personal title
If you go to say this page ...