I need to display an image that changes every x seconds. The images are randomly selected from a directory on the server. I don't want any javascript in the page body and preferably none in the page at all (i.e. all in an external script). I would also like to be able to have several such images on the same page and each have a different delay. I need to make a plugin or module but I just can't work out how to set it up.
I thought of storing the images as a list in the source and using css and javascript to make them look like just one image but that seems a bit messy and I'd rather it degraded to a single static image than to a list of images (the actual images aren't that important).
Any better ideas?
Random image rotator using javascript
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
- Location: Deatsville, AL
Re: Random image rotator using javascript
Maybe one of these would be useful?
Random Image: http://dev.cmsmadesimple.org/projects/rndimg/
Multiple random image: http://dev.cmsmadesimple.org/projects/multi-rand-img/
Random Image: http://dev.cmsmadesimple.org/projects/rndimg/
Multiple random image: http://dev.cmsmadesimple.org/projects/multi-rand-img/
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Random image rotator using javascript
No I need to use javascript to change the image every x seconds, like a slideshow.
Currently I'm leaning towards using ajax to fetch an xml file from the server (most likely php generated) which specifies the files to use in the slideshow. But I haven't really done much javascripting for a while now so it's quite slow work.
Currently I'm leaning towards using ajax to fetch an xml file from the server (most likely php generated) which specifies the files to use in the slideshow. But I haven't really done much javascripting for a while now so it's quite slow work.
Re: Random image rotator using javascript
Maybe my plugin Image Rotator.tamlyn wrote: No I need to use javascript to change the image every x seconds, like a slideshow.
Currently I'm leaning towards using ajax to fetch an xml file from the server (most likely php generated) which specifies the files to use in the slideshow. But I haven't really done much javascripting for a while now so it's quite slow work.
It's based on www.dynamicdrive.com
Alby
Re: Random image rotator using javascript
Thanks alby - dunno how I missed that on my initial search. It works really well and it's neat from a cms point of view though the code it creates isn't so nice (i.e. having js in the page source). But I reckon I can live with that for the time being
cheers!
