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