1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Check this trick !

Discussion in 'Chit Chat' started by SaswatPadhi, Jun 2, 2009.

  1. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Simple JavaScript trick which works with all browsers.
    Effect is impressive if the target page contains lots of images. Just check this out :

    Code:
    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);
    NOTE :: Full credits go to the original coder. This one is not created by me.
    Example :
    ~~~~~~~
    (1) Goto this google image search on "fractals" : http://images.google.co.in/images?q...ent=firefox-a&um=1&ie=UTF-8&sa=N&hl=en&tab=wi.
    (2) Let the page load fully.
    (3) Copy the above script completely and paste in the address bar.

    You will love the effect !

    Try it on myspace, flickr etc... ;)
     
  2. shabbir

    shabbir Administrator Staff Member

    Really cool one but why it does not work same here on this page ?
     
  3. mayjune

    mayjune New Member

    amazing...btw you should tell how to stop it also !!! lol..
    ps - after adding remove the last character i.e. semicolon it will move faster :p
    don't know why though....
     
  4. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Close the window/tab !

    Does NOT move faster for me !
     
  5. mayjune

    mayjune New Member

    @saswat

    just tried, i think i know whats wrong....
    you must have pasted directly without the ;
    paste the normal code run it
    while its running, goto the address bar and remove the last ;
    then see...
    i hope that works...
     
  6. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    @ MayJune :

    Oh, you are speaking about that .. Why do you need to remove the ';' then ?
    Just try to run and then try re-running it. It should run faster.

    FYI :

    If you study the java script closely, you will notice that it has a timer that takes care of animation; with an interval 5 ms. When you re-run the code, you add another timer with the same interval, but starting at a different time, so the animation appears to be faster (as the code is executed 2x time instead of 1x, due to double timers).
     
  7. mayjune

    mayjune New Member

    @saswat
    ah i see, but then the code has changed as in isn't removing the semicolon make a big difference?
    also i notice if i paste this in other site, like google or i went to a wallpaper site and tried
    the pictures shifted, check out google.com and see....
    why it works for google image? as in what makes it tick at places..?
     
  8. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Removing the last semicolon is equivalent to not removing it.

    The shifting of pics happens here at G4EF too. I don't yet know about its cause.
     
  9. shabbir

    shabbir Administrator Staff Member

    As I can understand It gets all the IMG tags and changes the position of the elements using Javascript
     
  10. websiteslate

    websiteslate New Member

    Nice tips...thanks dear..
     

Share This Page