显示文件夹中的图像(幻灯片) [英] Display Images From A Folder (slideshow)

查看:128
本文介绍了显示文件夹中的图像(幻灯片)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图谷歌并找出如何制作一个.php脚本,它将自动幻灯片显示文件夹中的图像,我只是设法让图片自动显示在php页面上,但我无法弄清楚如何让它们一个接一个地滑动,就像幻灯片一样。

I have been trying to google and find out how to make a .php script that will make a an automatic slideshow of images from a folder, I've only managed to get the pictures to automatically show up on the php page, but I can't figure out how to make them slide one by one, like a slideshow.

这里是图片显示页面的网址,所以你可以看看
这是我用过的代码。

Here is the url to the page where the images show up, so you can have a look Here is the code I've used.

<?
$files = glob("images/*.*");
for ($i=0; $i<count($files); $i++)
{
    $num = $files[$i];
    echo '<img src="'.$num.'" alt="random image" />'."<br><br>";
}
?>

你知道怎么做到这一点吗?还是另一种方式呢?更方便吗?
Java / XML?

Do you know how to make this happen? Or another way to do it? easier way? Java/XML?

推荐答案

要影响客户端,您需要使用JavaScript。 PHP只回显服务器上的静态内容。

To affect the client side, you'll need to use JavaScript. PHP only echos out static content on the server.

以下是可能使用的选项列表

Here is a list of options you could use

这篇关于显示文件夹中的图像(幻灯片)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆