I want the image on a web page to automatically change with a slide show type effect where a specific page image cycles from one to the next through an array of images.

I know how to have it load one randomly so that on each refresh it changes to a new one, but how could you use php to have it cycle through some photos changing every 30 or 40 seconds to a new image without an apparent refresh of the entire page?

It might be nice to do a fading in (from black) and out (to black) for this but I can live without the fading. I could see this array accessing maybe 50 images.

Is this doable in pHP or is it more of a JavaScript thing? Are there any open source slide show functions you would recommend that might do what I am after?

Thanks!

    The only way you can do with without the "aparent" refershing of the PHP page would be in my opinion, an iframe.

    This would be especially easy if all of the pictures are the same size/orientation.
    The fade in/out would be a Javascript and would be browser dependant.

    You could load the iframe, and have a function to load the images in an array, and pass parameters (or session data) of which picture is to be displayed next.

    There is a random image generator that someone else was asking about, you could use the same sort-of idea. [thread=10338069]Here[/thread].

    I would recommend using a for statement (much like the program calls for) but instead of displaying x number of images, have it just auto increment a variable (such as a session var).

    If I havn't confused you anyways.

      big.nerd wrote:

      The fade in/out would be a Javascript and would be browser dependant.

      This is true, however you can program it so if javascript is enabled it does the extra effects and if not it can do the basic iframe approach.

      Some useful JavaScript libraries that might help;

      Prototype (awesome)
      Script.aculo.us (effects library)
      MooFX (another effects library)

        Write a Reply...