$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
}
}
}
}
The thing you need is this: 1. read the files of your image gallery folder via Java, PHP or another Server-Side languages. 2. make a list of their names (and if you like other information). 3. show them via javascript OR jQuery...
you can read the folder files by using this code in 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
}
}
}
}
There are many free javascript and jQuery Image Sliders & Carousels in the net... Some of them even can read a folder of images (but I don't remember their names)...
Take a look at these places (and you can find more by googling)...
发布评论
评论(1)
你需要的是这样的:
1.通过Java、PHP或其他服务器端语言读取图库文件夹中的文件。
2. 列出他们的姓名(如果您需要其他信息)。
3. 通过 javascript 或 jQuery 显示它们...
您可以使用 PHP 中的以下代码读取文件夹文件:
有许多免费的 javascript 和 jQuery 图像滑块 &网络中的轮播...其中一些甚至可以读取图像文件夹(但我不记得它们的名字)...
看看这些地方(你可以通过谷歌搜索找到更多)...
http://www.blogohblog.com/20-killer-image-sliders-carousels/
http://www.vivalogo.com/vl -resources/javascript-slideshows-sliders-carousels.htm
The thing you need is this:
1. read the files of your image gallery folder via Java, PHP or another Server-Side languages.
2. make a list of their names (and if you like other information).
3. show them via javascript OR jQuery...
you can read the folder files by using this code in PHP:
There are many free javascript and jQuery Image Sliders & Carousels in the net... Some of them even can read a folder of images (but I don't remember their names)...
Take a look at these places (and you can find more by googling)...
http://www.blogohblog.com/20-killer-image-sliders-carousels/
http://www.vivalogo.com/vl-resources/javascript-slideshows-sliders-carousels.htm