PDA

View Full Version : Try This For Some Fun


MightyGem
2nd Nov 2006, 01:26
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);

luoto
2nd Nov 2006, 05:47
Did nothing in Safari :()

Mr Grumps
2nd Nov 2006, 06:31
Didn't do anything in IE7 either. :suspect:

Jhieminga
2nd Nov 2006, 07:16
nothing on Firefox 2 either.

robdesbois
2nd Nov 2006, 08:25
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.

MightyGem
3rd Nov 2006, 01:24
Yes, very strange. If I go back to edit the post, that space isn't there. :confused:

Mr Grumps
3rd Nov 2006, 06:13
Works well after that space removal. :cool:

rotorcraig
3rd Nov 2006, 06:55
All of the flying things still work if you click them (but took me a while to "catch" the Reply button!)

RC

Globaliser
3rd Nov 2006, 08:32
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?

robdesbois
3rd Nov 2006, 08:45
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 :8. I can't really be bothered to work out the maths :yuk:

Jhieminga
3rd Nov 2006, 08:55
Works ok, but you'll need a page with relatively small images to get a good result. If you go to say this page (http://cgi.ebay.com/ebaymotors/ARCHER-FACTORY-AIR-NEW-PAINT-INT-GARMIN-430_W0QQitemZ180045467597QQihZ008QQcategoryZ63677QQrdZ1QQcmd ZViewItem)and paste the string in the address bar (removing the extra space of course) you'll see what I mean.

Globaliser
3rd Nov 2006, 10:44
If you go to say this page (http://cgi.ebay.com/ebaymotors/ARCHER-FACTORY-AIR-NEW-PAINT-INT-GARMIN-430_W0QQitemZ180045467597QQihZ008QQcategoryZ63677QQrdZ1QQcmd ZViewItem) ...OT, but that page is worth visiting for itself. I never thought I'd see the day when sex was being used to sell light aircraft. Whatever next - will A and B deploy bikini-clad hosts at Farnborough and Paris? :)

robdesbois
3rd Nov 2006, 10:50
will A and B deploy bikini-clad hosts at Farnborough and Paris? :)

Fingers crossed! :}

Farrell
3rd Nov 2006, 19:42
Heheheh!

That's great fun!

Now......how can I use it for mischief! :E

If you do it on the front page of pprune it looks great!