我想在我的网站上做一个幻灯片,但问题是setInterval只有一次.它加载我的文件只有一个时间结束然后停止.
代理代码:
main.html中
<img src="images/ex/full.jpg" width="800" height="377" alt=""> <script> $(document).ready(function(){ var refreshId = setInterval(function(){ $('#center').load('images/gallery/best/rotate.PHP'); },5000); }); </script>
rotate.PHP
<img src="images/gallery/best/random.PHP?".<?PHP echo rand(0,1000) ?>."" width="800" height="377" alt="">
random.PHP包含一个从所选文件夹加载随机图像的代码,它的效果很好.
忘了提到,我也包含灯箱脚本.也许他们不一起工作?
头:
<Meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="vendors/jquery/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="vendors/js/prototype.js"></script> <script type="text/javascript" src="vendors/js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="vendors/js/lightBox.js"></script> <link rel="stylesheet" href="styles/style.css" type="text/css" /> <link rel="stylesheet" href="styles/lightBox.css" type="text/css" />
谢谢.