Rotating background upon refresh or reload

Discussion in 'HTML & Website Design' started by genius, Apr 25, 2010.

  1. #1
    Hello,

    I want to make a page similar to this http://www.pumafootball.com/ to be more accurate , every time I acces the page the background is different , and on every refresh the bg changes.I want to have 4-5 images and rotated them..how can i do this ?

    I've found this script :

    <script language="JavaScript">
    <!--
    /*
    Random Image Link Script
    By Website Abstraction (http://www.wsabstract.com)
    and Java-scripts.net (http://www.java-scripts.net)
    */
    
    function random_imglink(){
     var myimages=new Array()
     //specify random images below. You can have as many as you wish
     myimages[1]="logo.png"
     myimages[2]="logo3.png"
     myimages[3]="logo2.png"
    
     var ry=Math.floor(Math.random()*myimages.length)
    
     if (ry==0)
        ry=1
        document.write('<img src="'+myimages[ry]+'" border=0>')
    }
    
     random_imglink()
    //-->
    </script>
    PHP:
    But this script doesn't repeat the image so it may be a bg.

    Have any ideeas ?

    Thank you
     
    genius, Apr 25, 2010 IP
  2. CrashOver

    CrashOver Peon

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    alistapart . com/d/randomizer/rotate.txt

    javascript . internet . com/miscellaneous/random-image-rotator . html
     
    CrashOver, Apr 25, 2010 IP
  3. genius

    genius Well-Known Member

    Messages:
    535
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #3
    The problem is that they can;t be set up for the background.
     
    genius, Apr 25, 2010 IP