Getting file names with scriptaculous

Getting file names with scriptaculous

冬天旳寂寞 发布于 2021-11-27 字数 368 浏览 756 回复 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?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北座城市 2022-06-07 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.