I am creating a little portal for my design department at work. On the homepage of the portal, there is a section for a random image that people can submit. This image has a preset width and height so it fits into the layout. When you load the index page, it randomly selects one of the images from the database. However, I want people to be able to click on the image and load a different one. I don’t want to reload the entire page and get a new randomly selected one because it is possible they could keep getting the same image over and over. If they random get image #5, I want them to see image #6 when they click, then image #7 when they click again, so on and so forth. When they reach the last image, they go back to image #1. Make sense?
Any ideas? I have tried looking at scripts that automatically change the image (with cute little fade ins), but I want the change to happen based on the user’s actions.
The script. I try it, and nothing happens. The only difference is that I create the list of files dynamically so I can’t use an external JS file. Instead, I just put it all in the <head> tag.
I realize this thread is ancient, but I’m so glad I found it because this script is exactly what I need. Works like a charm too (even in FireFox and Google Chrome).
The only thing I need is some hint as to how (or if) it might be possible to insert multiple instances of the PixLoop into a single page.
At the moment I have each picture sequence on its own separate page, and they’re embedded into the main page with iFrames. It works, but it’s definitely not an ideal set-up.
So any help or advice, on how to eliminate the iFrames and insert multiple PixLoops directly into the page, would be greatly appreciated.
Thanks.
PS: In my current set-up with the iFrames, the script for each PixLoop is embedded into the HEAD of the page that holds the picture sequence.
The PixLoop.js version keeps giving me an “invalid character” warning for the first character on line 1