[1+1=2]
OneAndOneIs2

Sun, May 27, 2007

[Link][Icon]Cool bit of java

Came across this here via a long series of links.

What you do is, you copy this bit of java and paste it into the "Location" bar, and then watch the graphics do interesting things.

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

At google.com it's a bit of a laugh, but it was at my "list of smilies" page that it gave really cool results.

Have a play and see what other websites work well with it :o)

Comments:

Comment from: tuxdev [Member] Email
Yeah, it's really interesting to watch on the smily page cause you can see the algorithm.

Too bad that most websites nowadays are dynamic and the trick doesn't work on them.

Argh, I hate the name JavaScript, especially since it was intentionally named to create confusion. Java != JavaScript
PermalinkPermalink 27/05/07 @ 22:48
Comment from: hari [Member] Email · http://hari.literaryforums.org
You made a typo. JavaScript is not Java. :-p

Cool things.
PermalinkPermalink 28/05/07 @ 04:16
Comment from: hari [Member] Email · http://hari.literaryforums.org
By the way, this happens in google.com/ncr (the international search) and not in google.co.in which is my default search site.

Results vary in other sites. Sometimes nothing happens.
PermalinkPermalink 28/05/07 @ 07:56
Comment from: Andrew [Visitor] Email
Eh, Java and JavaScript are similar enough (I code extensively in both, so I know) that one can easily and fluently go from Java to JavaScript by just learning a few basic principles. The switch from Java to, say, C++, is much more of a shock.
PermalinkPermalink 29/05/07 @ 13:42

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Categories

July 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
  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      

Search

Misc

XML Feeds

What is this?
eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by
b2evolution

blank