views:

50

answers:

1

I am looking to create basically an image rotator with scriptaculous. The trick is I want to use the images that are in a certain directory to drive the rotations.

For Example if there are 3 files in the directory then it rotates with 3 images, 5 it will rotate five images.

How can I read the file names to use/determine for Scriptaculous?

+2  A: 

Scriptaculous is simply a JavaScript library. Being JavaScript means it cannot access the filesystem. You'll need some server-side code to do this and integrate the list of files into JavaScript as a string or JSON.

Something like:

imgList="a.gif,b.gif,c.gif".split(",")

...can build you a simple array.

Diodeus