Jump to content

Cool Trick


felix
 Share

Recommended Posts

A friend just showed me this.

Go onto any site, here now if you liek and type this into the address bar and hit go.

java script: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);

EDIT:

Okay, cos the forum is clever it's putting a space between the java and script at the beginning, so delete that space then try :icon_rendeer:

Edited by Felix
Link to comment
Share on other sites

 

 
 
 
 
Man that is cool, only problem how do you catch that pesky "add reply" button?

Heh, true.

You just copy it all and paste it into your address bar instead of the website address, then you gotta take out the space between java and script and hit go, it should work.

Link to comment
Share on other sites

 

Ok, its a piece of JS code that manipulates images on the page you are viewing. It works in IE , Firefox & Opera (edit after checking)

java script: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);

Type in http://www.youtube.com and copy and paste the code above and watch the images move around the screen ! (make sure you edit java script into one word removing the space as Felix said above)

Edited by AtomAnt
Link to comment
Share on other sites

 

I bet I look like a right coding noob, when really I'm not into it at all, a mate just showed me it.

Looks better on a page with more images on that google to be honest.

Works fine with Firefox for me, and apparently works with Opera too.

Link to comment
Share on other sites

 
 
 
 
 
 
 
 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
  • Create New...