Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Fun Javascript  (Read 1994 times)

0 Members and 1 Guest are viewing this topic.

Computer Hope Admin

    Topic Starter
  • Administrator


  • Prodigy

    Thanked: 248
    • Yes
    • Yes
    • Yes
    • Computer Hope
  • Certifications: List
  • Computer: Specs
  • Experience: Guru
  • OS: Windows 10
Fun Javascript
« on: January 08, 2007, 11:17:11 PM »
Something fun for you guys to play around with. I just happen to come across this while surfing around. Copy the below code into your address bar after loading any page and watch the images on that page fly around..

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);

The code moves all images on the page around your screen and does nothing malicious. Just something fun.  ;D
Everybody is a genius. But, if you judge a fish by its ability to climb a tree, it will spend its whole life believing that it is stupid.
-Albert Einstein

dl65

  • R.I.P.


  • Prodigy

    Thanked: 18
    Re: Fun Javascript
    « Reply #1 on: January 09, 2007, 12:15:16 AM »
    LOL ....... Good find

    dl65  ::)
    If you don't know the answer, it isn't a dumb question.

    Neil



      Expert
    • Fear me Track. Noone can escape my wrath.
    • Thanked: 3
      Re: Fun Javascript
      « Reply #2 on: January 09, 2007, 05:55:53 AM »
      Something to make the continue moving around would be fun.

      Peccavi



        Adviser

      • Hope Helps!
      • Thanked: 6
        Re: Fun Javascript
        « Reply #3 on: January 09, 2007, 07:19:35 AM »
        Cool. Doesn't work with Firefox. IE only.
        Computer Hope: Rise of the Machines!

        Neil



          Expert
        • Fear me Track. Noone can escape my wrath.
        • Thanked: 3
          Re: Fun Javascript
          « Reply #4 on: January 09, 2007, 02:36:06 PM »
          It works for me in Firefox.

          soybean



            Genius
          • The first soybean ever to learn the computer.
          • Thanked: 469
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 10
          Re: Fun Javascript
          « Reply #5 on: January 09, 2007, 03:53:40 PM »
          It works in IE and Firefox for me, but runs slightly faster in IE.