2 Replies Latest reply on Jan 14, 2009 3:08 AM by Tun Tun bags of fun

    Random backround image

    Tun Tun bags of fun Level 1
      Is it possible to have a series of random backround images on my home page?

      Thanks in advance.

      Chris.
        • 1. Re: Random backround image
          Level 7
          Tun Tun bags of fun wrote:
          > Is it possible to have a series of random backround images on my home page?
          >
          > Thanks in advance.
          >
          > Chris.




          Sure, search Google for a script. Heres one below (cut and paste it into
          the head section of your page).... add as many images as you like


          <script>

          var backgr1="bgimages/background_1.jpg"
          var backgr2="bgimages/background_2.jpg"
          var backgr3="bgimages/background_3.jpg"
          var backgr4="bgimages/background_4.jpg"
          var backgr5="bgimages/background_5.jpg"
          var backgr6="bgimages/background_6.jpg"

          var cur=Math.round(6*Math.random())
          if (cur<=1)
          backgr=backgr1
          else if (cur<=4)
          backgr=backgr2
          else
          backgr=backgr3
          document.write('<body background="'+backgr+'" bgcolor="#FFFFFF">')
          </script>
          • 2. Re: Random backround image
            Tun Tun bags of fun Level 1
            Brilliant, thanks for you help.