48 users online (1 members and 47 guests)  


  Results 1 to 2 of 2

Related

  1. Random Images    Forum: PHP Forum
    Replies: 1
  2. Random Border help    Forum: HTML Forum
    Replies: 2
  3. random image    Forum: CGI Perl Forum
    Replies: 3
  4. Random Boxes?? Help!    Forum: Myspace Forum
    Replies: 0
  5. random sponsors    Forum: HTML Forum
    Replies: 1
  1. #1
    Capo's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Aug 2002
    Location
    USA
    Posts
    69

    Random Pic Javascript

    Can anyone show me a simple javascript that will show a new pic everytime the page loads?

    I'd like the pic to be thumbnailed and link to the larger image when clicked on. Currently, I already have all the thumbnails made but I simply want a script that will post a new one on the main part of the site each time it is loaded or refreshed.

    Thanks

  2. #2
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Go to

    http://stpaul.jamrent.com

    and look at the source code. That shows the Sunday ~ Saturday image files based upon the day of the week. It will require cookies to keep track of page reloads for each visitor, but I'm sure that could also be done by revising the SCRIPT.

    The SCRIPT is all in

    <SCRIPT LANGUAGE="JavaScript"><!-- ¦
    ¦today = new Date(); ¦
    ¦day = today.getDay(); ¦
    ¦arday = new Array("i/sunday.jpg", "i/monday.jpg", "i/tuesday.jpg", "i/wednesda ...¦
    ¦ ¦
    ¦document.write("<img border=0 name=bigphoto src='" + arday[day] + "'>"); ¦
    ¦//--> ¦
    ¦</SCRIPT>


    (That was cut and pasted from my DOS QEdit program - ergo the odd characters.)



Tags for this Thread