Windows 7 Forums


Reply
Thread Tools

Funny script for Internet Explorer

 
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,091
Thanked: 450
Ian's Twitter Pag
 
      08-05-2009
I saw this script on another forum and thought it would be entertaining to people here

You'll need to be using Internet Explorer for this to work. Just pick any webpage (for example this very page!) and copy/paste the javascript in to the address bar and press enter.

It makes all of the images on the page fly around and provides a few seconds of amusement

Quote:
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 jannick(){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('jannick()',5); void(0);
 
Reply With Quote
 
 
 
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,091
Thanked: 450
Ian's Twitter Pag
 
      08-05-2009
Quote:
Originally Posted by clifford_cooley View Post
Paste to the address bar.
Yes, sorry, address bar I'm not sure why I typed title bar. I've edited the first post now.
 
Reply With Quote
 
clifford_cooley clifford_cooley is offline
(c_c)
clifford_cooley's Avatar
Join Date: Mar 2009
Location: Arkansas, USA
Posts: 4,442
Thanked: 924
 
      08-07-2009
Quote:
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 jannick(){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('jannick()',5); void(0);
Out of curiosity how many here can read this script

I can see
setting x and y values
setting the position to absolute for all document images with the for loop
setting coordinates through math functions using sin and cos
starting a loop with setInterval by running the jannick function every .005 seconds

I didn't understand the use of void(0); until I looked it up
It seem this void(0) is what keeps the window location from changing to the new address typed in the address bar.
Which by the way would have been "5453433" text in the window.

Last edited by clifford_cooley; 08-07-2009 at 07:57 AM..
 
Reply With Quote
 
olg207 olg207 is offline
Established Member
olg207's Avatar
Join Date: Feb 2009
Posts: 337
Thanked: 20
 
      08-07-2009
That is fantastic, funny as well. How do these people come up with this stuff :]

Last edited by olg207; 08-07-2009 at 03:49 PM..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process Explorer clifford_cooley Free Software Database 1 08-17-2010 09:47 AM
Windows 7 Annoyances Nibiru2012 General Discussion 6 03-17-2010 07:17 PM
Windows 7 explorer stopped working no programs open either hellllpppp!!!!!!!!!!!!!!!! laroijackson Windows 7 Support 2 02-02-2010 10:33 PM
Delay before executing logon script kenny782 Windows 7 Support 0 11-20-2009 08:29 PM
Internet Explorer Closes realdeb2 Windows 7 Support 1 08-16-2009 05:18 AM


All times are GMT +1. The time now is 01:13 AM.
W7Forums is an independent website and is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33