Announcement

Collapse
No announcement yet.

Header Design Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Header Design Issue

    Hello,

    I have searched the forums and can't find anything on this subject so i thought i would ask....

    Is it at all possible to have a random loading header image when the page is refreshed?

    For Example Code:

    </head>
    <SCRIPT LANGUAGE="JavaScript">
    var theImages = new Array()

    //Random-loading images
    theImages[0] = 'http://www.mydomain.com/img.jpg' //
    theImages[1] = 'http://www.mydomain.com/img1.jpg' //
    theImages[2] = 'http://www.mydomain.com/img2.jpg' //
    theImages[3] = 'http://www.mydomain.com/img3.jpg' //

    var j = 0
    var p = theImages.length;
    var preBuffer = new Array()

    for (i = 0; i < p; i++){
    preBuffer[i] = new Image()
    preBuffer[i].src = theImages[i]
    }
    var whichImage = Math.round(Math.random()*(p-1));

    function showImage(){
    if(whichImage==0){
    document.write('<a href ="http://www.mydomain.com/index"><img src="'+theImages[whichImage]+'" border=0 width=720 height=450></a>');
    }
    else if(whichImage==1){
    document.write('<a href ="http://www.mydomain.com/index"><img src="'+theImages[whichImage]+'" border=0 width=720 height=450></a>');
    }
    else if(whichImage==2){
    document.write('<a href ="http://www.mydomain.com/index"><img src="'+theImages[whichImage]+'" border=0 width=720 height=450></a>');
    }
    else if(whichImage==3){
    document.write('<a href ="http://www.mydomain.com/index"><img src="'+theImages[whichImage]+'" border=0 width=720 height=450></a>');
    }

    }

    </script>
    </head>


    and then

    <script>showImage();</script>

    where the header would be placed.... just wondering any help is cool..

    Thanks,
    Phill
    Thanks,
    Phill

    ------------------------------------------
    Middlesbrough, England

    #2
    but... you just gave one possible solution.



    diddnt it work?

    looks sound to me.

    Comment


      #3
      i just wondered if it would work? Before i tried anything out...
      Thanks,
      Phill

      ------------------------------------------
      Middlesbrough, England

      Comment


        #4
        hehe.

        JUMP IN MAN!!!!

        Comment


          #5
          second person today who has posted code here before bothering to try it instead!

          what's wrong with people?
          LOL

          Are y'all scared or something!
          Just backup and try it!
          Tracey

          Comment


            #6
            if you want to test the code first, create a simple page in dreamweaver. Once it works paste it into actinic

            Comment


              #7
              lee, will be happy though, at least he looked in the forums first

              Comment

              Working...
              X