Interesting piece of javascript

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Post Reply
pr0gram the pr0grammer
Donator
Posts: 698
Joined: Fri Aug 18, 2006 12:05 pm
Location: Or-stray-liagh

Interesting piece of javascript

Post by pr0gram the pr0grammer »

If you go to a site in Firefox or IE7, then copy the below into the address bar (as one line) and hit ENTER, fun things will happen with the site's graphics:

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

Best to try on a site with lots of images, like for example a Google image search:
http://images.google.com.au/images?hl=e ... rch+Images
pr0gram the pr0grammer
BetaArchive retiree | OSBA Expat

Andy
User avatar
Administrator
Posts: 12628
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

thats cool!

Beta Freak
FTP Access
Posts: 786
Joined: Sat Oct 14, 2006 12:05 am

Post by Beta Freak »

After pasting it, pressing enter more will make them go round faster.

idontknow
User avatar
FTP Access
Posts: 149
Joined: Tue Nov 28, 2006 11:39 pm

Post by idontknow »

That is amazing, though rather pointless...

Wonder what else you can do with Javascript?

Andy
User avatar
Administrator
Posts: 12628
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

JavaScript is quite powerful. This forum uses JS to display the "New PM Message" box (which FF stops unless you allow it).

empireum
Donator
Posts: 3557
Joined: Sat Sep 30, 2006 5:00 pm

Post by empireum »

Andy wrote:JavaScript is quite powerful. This forum uses JS to display the "New PM Message" box (which FF stops unless you allow it).
Ah, that's why I have not been seeing them

Andy
User avatar
Administrator
Posts: 12628
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

You should still get the "FireFox stopped a pop-up" yellow box whenever a pop-up tried to appear, unless you hit block for this site. I leave it to just show the yellow bar and that tells me Ive got a PM, since its the only time one will appear for this site.

___
User avatar
Donator
Posts: 1914
Joined: Sat Aug 19, 2006 12:19 am
Location: New Zealand

Post by ___ »

haha, thats crazy

Jeff
User avatar
Donator
Posts: 1004
Joined: Mon Sep 04, 2006 1:06 pm
Location: USA

Post by Jeff »

Wow... that's amazing!
-Jeff

Luckie
User avatar
Donator
Posts: 1115
Joined: Thu Aug 24, 2006 8:03 am
Location: Germany

Post by Luckie »

this is old

Jordan posted something like this some times ago on thehotfix
"Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why."

fzajac
User avatar
Donator
Posts: 1432
Joined: Thu Aug 31, 2006 2:45 pm
Location: UK
Contact:

Post by fzajac »

Wow. Thats cool! i haven't seen it before...

Post Reply