I really liked Jon Raasch’s jquery-powered slideshow, but integrating it into a page requires a bunch of steps:
- Add the jQuery library
- Add the CSS with opacity and z-layer set properly
- Upload the images for the slideshow someplace
- Enumerate the images’ URLs that you want to cycle through
Adding images is tedious (you have to upload AND update the image list), and there’s no clean support for multiple slideshows per page. I wanted a process that made integration into other pages trivial.
I decided that an IFRAME to host the slideshow would keep jQuery and the slideshow CSS partitioned away from the rest of the embedding page, and would let adding slideshows to new pages have an easy-to-follow recipe, no matter what was already going on in the existing page. The IFRAME needed the template HTML, and if I used PHP, I could generate the image list for the slideshow automatically from the images that live in the same directory as the PHP script.
So here are the new instructions, using this IFRAME approach:
- Make a directory that will contain the images you want in the slideshow. For this example it’s “
- Copy this file into the “slideshow-demo” directory and name it
- Copy the images for the slideshow into the directory.
Remember to resize all the images to the same dimensions.
- On the page you want to embed the slideshow, add
XHTML12<iframe src ="slideshow-demo/" width="300" height="200"scrolling="no" frameborder="0"></iframe>
Replace the width and height to be the common dimension of your images
Here’s a working demo: