views:

56

answers:

2

I'm looking for a simple jquery slide show option that pulls photos from a directory. I'm not well versed in writing this this sort of thing myself and everything I've been able to find doesn't really do what I need (pull photos from a directory) or is over my head/lacks clear instruction.

Any suggestions would be greatly appreciated.

A: 

You'll find a couple of details examples of great jQuery slideshows here with instructions of how to implement them http://www.webanddesigners.com/15-jquery-slideshow-and-plugins

Regards.

StudiousJoseph
A: 

Any number of slideshow plugins for jQuery will work. All you will need to do is build an array of images to be passed to the plugin.

I did this once on my site. I wrote a some php that would grab all the images in a folder.

// Declare return string
$fileNames = "";

// Get name of all files in folder and add it to return string
   foreach (new DirectoryIterator("/path/to/folder") as $file) {
    if (! $file->isDot()) {
        if ($file->isFile()) {
            $fileNames .= $file . ":";
    }
}
}

// Return string
echo $fileNames;

Then call it with jQuery with Ajax and then split it into an Array.

var fileName;
$.ajax({
            type: "GET",
            url: "path_to_php_file.php",
            success: function(msg) {
                fileNames = msg.split(":");
            }
       });

There are other variations on this but this is simply what I did.

PortableWorld
I guess I'm in deeper than I thought, I'm not even 100% sure what to do with what you posted.
Chris