Getting file names with scriptaculous
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?
如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

评论(1)

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.
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。