Results 1 to 2 of 2

Thread: Random photo

  1. #1


    Member Since
    Aug 11, 2005
    Posts
    285
    Random photo
    On my webpage I have a rectangle with my "photo of the day" I have had to change it manually everyday. But I want to make it so when somebody comes to my webpage it will just randomly change when they access the page, it doesnt even have to be daily, just everytime the page is accessed the photo will change. If I put all of the photos I want it to cycle through ina folder on my server how would I do it, I dont know any php or java, just some html, and if it is something in java is "copy and pastable"

  2. #2

    puaerotch's Avatar
    Member Since
    Sep 21, 2005
    Location
    ohio
    Posts
    809
    Specs:
    iBook G4 OSX Tiger
    just put it where you want the photos and all you have to do is change the info in orange

    <script LANGUAGE="JavaScript">
    <!-- Begin
    var how_many_ads = 2;
    var now = new Date()
    var sec = now.getSeconds()
    var ad = sec % how_many_ads;
    ad +=1;
    if (ad==1) {
    txt="";
    url="http://url the image links to";
    alt="image label";
    banner="url of the image itself (ex. http:/ /website.com/imageurl.jpg)";
    width="x";
    height="x";
    }
    if (ad==2) {
    txt="";
    url="http://url the image links to";
    alt="image label";
    banner="url of the image itself (ex. http:/ /website.com/imageurl.jpg)";
    width="x";
    height="x";
    } HERE
    document.write('<center>');
    document.write('<a href=\"' + url + '\" target=\"_top\">');
    document.write('<img src=\"' + banner + '\" width=')
    document.write(width + ' height=' + height + ' ');
    document.write('alt=\"' + alt + '\" border=0><br>');
    document.write('<small>' + txt + '</small></a>');
    document.write('</center>');
    // End -->
    </script>



    to add more than 2 add the following where it says HERE and change the numbers to the necessary numbers (dont forget to remove the HERE )

    if (ad==2) {
    txt="";
    url="http://url the image links to";
    alt="image label";
    banner="url of the image itself (ex. http:/ /website.com/imageurl.jpg)";
    width="x";
    height="x";
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I-photo doesn't enlarge photo when you double click on it
    By crittercamp in forum OS X - Operating System
    Replies: 1
    Last Post: 04-22-2013, 12:44 AM
  2. Photo quality when uploading to photo publishing sites
    By Cknapp6 in forum OS X - Operating System
    Replies: 3
    Last Post: 12-27-2012, 02:04 PM
  3. Can 8 transfer Aperture 3 photo info to web site photo?
    By Techigrandma in forum Web Design and Hosting
    Replies: 0
    Last Post: 05-09-2012, 09:26 AM
  4. Newbie iPhone 4s owner - only 1 photo showing in photo app..pls help!
    By Vicki1987 in forum iPhone Hardware and Accessories
    Replies: 0
    Last Post: 10-17-2011, 09:44 AM
  5. Random screensaver but without : Photo library etc...
    By bellastrada in forum OS X - Operating System
    Replies: 0
    Last Post: 06-04-2005, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •