假设我有一堆基于日期的文件名的图像,如下所示:
URL /图像/ top20110326.png
URL /图像/ top20110327.png
URL /图像/ top20110328.png
URL /图像/ top20110329.png
URL /图像/ top20110330.png
URL /图像/ top20110331.png
URL /图像/ top20110401.png
URL /图像/ top20110402.png
我想找到一些可以提供这些功能的代码或工具或插件:
PS:服务器是PHP服务器
答案 0 :(得分:3)
你需要的是这个: 1.通过Java,PHP或其他服务器端语言读取图库文件夹的文件。 2.列出他们的名字(如果你喜欢其他信息)。 3.通过javascript或jQuery显示它们......
您可以在PHP中使用此代码来读取文件夹文件:
$dir = getcwd()."/ImageGalleryFolder/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (($file != '.') && ($file != '..' ) && !is_dir($dir.$file)) {
// YOU HAVE FILENAME HERE ($file), USE IT AS YOU LIKE!
// note: the complete path of your file is $dir.$file
}
}
}
}
有许多免费的javascript和jQuery Image Sliders&网络中的旋转木马...其中一些甚至可以读取图像文件夹(但我不记得他们的名字)......
看看这些地方(你可以通过谷歌搜索找到更多)......
http://www.blogohblog.com/20-killer-image-sliders-carousels/
http://www.vivalogo.com/vl-resources/javascript-slideshows-sliders-carousels.htm