Advanced Search

Results 1 to 4 of 4

Thread: Random Image Display on Page

  1. #1
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Random Image Display on Page

    Hi,

    I've been doing various searches on the site to try and find something in PHP or javascript that would randomly or even sequentially display images from a folder that is part of the website. The image sizes would vary, and I would like it to just display them one at a time with possibly a caption added to certain images.
    It can pull the images from a source directory and dump them into an IFrame. I don't care just as long as it is one image at a time of varying sizes. The Iframe could be set to the size of the largest image in the directory then the others could just display in the center. Or maybe there is another option?

    Thank you in advance,

    Cody

  2. #2
    Join Date
    Nov 2006
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Do you want a random image to show up on reload or say every 10 seconds a new image apears?

  3. #3
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    On reload, but if it is easy and possible the every few seconds thing would be fantastic!

    I checked my hosting service and found out that I don't have PHP because I'm hosted on a Windows server. I might not be able to migrate over to Linux with the stuff I'm already using. I was kind of hoping for an image display script that didn't have to have the image file names added to the script, but would just get them from a directory.
    Last edited by Cody; 12-14-2006 at 11:58 AM. Reason: Found out something about host server.

  4. #4
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    797
    Thanks
    86
    Thanked 2 Times in 2 Posts

    Default

    Somthing like this ? You can see it at the bottom ofwww.casariegoart.com (the sponsors)

    Place in head:
    Code:
    <script language="JavaScript1.1">
    <!--
    var slidespeed=3000
    var slideimages=new Array("IMG.gif","IMG.jpg","IMG.png")
    var slidelinks=new Array("http://www.site.com","http://www.site.be","http://www.site.com")
    var newwindow=1 
    
    var imageholder=new Array()
    var ie=document.all
    for (i=0;i<slideimages.length;i++){
    imageholder[i]=new Image()
    imageholder[i].src=slideimages[i]
    }
    
    function gotoshow(){
    if (newwindow)
    window.open(slidelinks[whichlink])
    else
    window.location=slidelinks[whichlink]
    }
    
    //-->
    </script>
    Place in body:
    Code:
    <a href="javascript:gotoshow()"><img src="FIRSTSHOWNIMG.gif" name="slide" border=0 style="filter:blendTrans(duration=3)"></a>
    
    <script language="JavaScript1.1">
    <!--
    var whichlink=0
    var whichimage=0
    var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
    function slideit(){
    if (!document.images) return
    if (ie) document.images.slide.filters[0].apply()
    document.images.slide.src=imageholder[whichimage].src
    if (ie) document.images.slide.filters[0].play()
    whichlink=whichimage
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
    setTimeout("slideit()",slidespeed+blenddelay)
    }
    slideit()
    
    //-->
    </script>
    Got this script from DD.

Bookmarks

Posting Permissions

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