0
我需要使用cycle2为特定文件夹中的图像运行幻灯片。下面是我的标记和php:Cycle2未运行
<div class="cycleShow">
<?php
$dir = 'img/';
$files = scandir($dir);
foreach($files as $file) {
if($file !== '.' && $file !== '..'){
$tag = '<img class="thumbNail" src="' . $dir . $file . '" />';
echo $tag;
}
}
?>
</div>
<button onClick="slideshow();">Start</button>
和功能.....
function slideshow() {
$('.cycleShow').cycle();
}
执行时,图像加载到div中。但没有点击按钮幻灯片。
你是否检查过开发者工具中的任何js erros? – 2014-12-06 10:48:04
不应该是'onclick =“...”'? – lexith 2014-12-06 10:49:53
没有js错误,什么都没有。 – Tom 2014-12-06 11:09:37