The Gang of Five
The forum will have some maintenance done in the next couple of months. We have also made a decision concerning AI art in the art section.


Please see this post for more details.

Fun with Javascript!

pokeplayer984

  • Member+
  • Littlefoot
  • *
    • Posts: 6993
    • View Profile
Here's a couple of fun things a friend of mine at another board showed me.

Put the following into your web address URL bar and watch the fun:

javascript:x=0;e=document.body;e.style.position="absolute";function rt(){e.style.top=100-(50*Math.cos(x*Math.PI/180))+"px";e.style.left=100+(50*Math.sin(x*Math.PI/180))+"px";x+=5}; setInterval("rt()",50);void(0);

Also try this one:

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

Note: Please make sure you have the latest Java updates before putting them in.

Note 2: To fix this, just hit the Back button, and you'll be fine.


Alex

  • Petrie
  • *
    • Posts: 895
    • View Profile
I usually can't stand java, but that was kinda cool :p


landbeforetimelover

  • Member+
  • Littlefoot
  • *
    • Posts: 8495
  • Littlefoot
    • View Profile
    • http://www.thelandbeforetime.org
You have to make sure the scripts will work properly with browsers.  Neither of them work with Firefox. :p


pokeplayer984

  • Member+
  • Littlefoot
  • *
    • Posts: 6993
    • View Profile
Quote from: landbeforetimelover,Jun 22 2009 on  09:46 PM
You have to make sure the scripts will work properly with browsers.  Neither of them work with Firefox. :p
I beg to differ as I tested them out with Firefox myself and they worked for me. :D


landbeforetimelover

  • Member+
  • Littlefoot
  • *
    • Posts: 8495
  • Littlefoot
    • View Profile
    • http://www.thelandbeforetime.org
Oh.  I see now.  Sorry.  I was on a very small resolution and didn't copy the whole code. :p Now I'm on my master machine and all works well.  Pretty cool.....but IE wouldn't handle a script like this very well.


pokeplayer984

  • Member+
  • Littlefoot
  • *
    • Posts: 6993
    • View Profile
Quote from: landbeforetimelover,Jun 22 2009 on  11:20 PM
but IE wouldn't handle a script like this very well.
I'm not willing to test it myself, but if anything, I bet it would crash! :P:


landbeforetimelover

  • Member+
  • Littlefoot
  • *
    • Posts: 8495
  • Littlefoot
    • View Profile
    • http://www.thelandbeforetime.org
Quote
I'm not willing to test it myself, but if anything, I bet it would crash! tongue.gif

No.  It just blocks EVERYTHING.  It won't even allow a Javascript popup window.  Just stupid.  ALL other browsers allow it just fine, but IE identifies it as a "security risk". :rolleyes: I can't imagine what it would say to something like this.  You'd probably have to disable all security in order to get it to work.