some codes do magic

Discussion in 'The ChitChat Lounge' started by sachoo, Sep 14, 2006.

  1. sachoo

    sachoo drenched in my pain again

    1) Open any website.....which contains images.


    2) Copy below given code and paste on the Address bar of the same browser window and enter

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

    3) All images will be :rock: :rock: :rock: :rock:

    n now try

    javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=1000; 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)


    Images will be :shock: :shock: :shock: :shock:

    Have fun......
     
  2. vini

    vini Repeat Offender

    nothing happened :annoyed:
     
  3. SG1

    SG1 &quot;Brown Jesus&quot;

    what a dumb idea .. nothing working .. :s
    Magic faild buddy take your stuff and out the door now....
     
  4. Morbid_Angel

    Morbid_Angel Sid the sloth

    maybe he dint instruct us ryte with the codes.

    You sure we gotta put that thing on the address bar erasing website URL?
     
  5. SG1

    SG1 &quot;Brown Jesus&quot;

    i rather eat a Kit Kat bar and jam ma crunches yummyyyyyyyyy
     
  6. notty_lad

    notty_lad sudo undress

    javascript:R=-1;DI=document.links;DIL=DI.length;function A(a,b,c){return Math.sin(R/350*6.28*b+a)*c+c}function B(a){DIS=DI.item(a).style;DIS.position='absolute';DIS.left=A(5,100,500);DIS.top=A(5.6,60,150)}setInterval('R++;B(R%DIL)',15);void(0)


    You meant this code right you 'Magician' ?

    Lol @ the magic
     
  7. vini

    vini Repeat Offender

    .
    ^ post#2
     
  8. alpha1

    alpha1 I BLUES!

    LOL kissi ne theek hi kaha hai:
     
  9. this is getting very popular nowdays..but nothin is working. and nobody tells what exactly happens...
     
  10. lord_neo

    lord_neo Guest

    Thats some cool stuff you got there...
     
  11. Morbid_Angel

    Morbid_Angel Sid the sloth

    cool stuff? -_-
    how'd it work?
     
  12. lord_neo

    lord_neo Guest

    It worked the firts time i tried, i think the formatting gets messed up when you paste the code here.

    Try putting the code in word pad or word.
     
  13. lord_neo

    lord_neo Guest

    Try this....


    //The wakky script that move images...



    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; //return all the images on the page...in array so DI is array now
    DIL=DI.length; //get length of DI array so it can be used for getting all images one by one in the loop below
    function A()
    {
    for(i=0; i<DIL; i++)
    {
    DIS=DI[ i ].style; //get style of each image and store in DIS
    DIS.position='absolute';
    DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; //change position of every image after interval of 5ms
    DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5
    }
    R++ //change R which is used in setting the position so that with each function call each image will have new position.
    }
    setInterval('A()',5); //setInterval calls given function reference or expression at each interval spec in ms.
    void(0) //just to indicate that function is not returning anything.


    //The spead of changing position changes with each stroke of "Go". This is a puzzle for me right now.


    Now what it does is, it takes all the images from ur document and rotates it like a marry-go-round or something. All u need to do for it is u just copy whole script in one line and paste in the address bar and it starts working.

    Got it?

    Now when u click the "Go" button in the browser every time its speed is increasing.with each click it gets faster.
     

Share This Page