Hi all,
Is anyone familiar with scriptaculous? I am trying to create a page that reads a directory of images and displays them with scriptaculous. So far from what I have, the code does work in displaying the catagories (each folder) but I can't figure out why it will not display each image file in the sub-directory. So far it's only displaying the very first image.
I'm thinking I need to use a for loop or something similiar, but I cannot think of a way to implement it into the existing code.
Here is my code:
<?php
echo "<div id = noWrap>";
echo '<div id = img_cursor>';
$directories = array('gemstone', 'bella', 'passage', 'sedona', 'deepstar', 'crystalline');
foreach ($directories as $directory){
$mydir2=opendir("images/laminate/Wilsonart_Laminate_Colors/$directory");
$cats2=array();
echo "<h2><a href=\"#\" onclick=\"Effect.toggle('d2','BLIND', {duration: 2.0}); return false;\">$directory</h2><br /></a>";
while(($cat2=readdir($mydir2)) !==false){
if ($cat2 != "." && $cat2 != ".." && strpos(strtolower($cat2),"-thumb.jpg") !== false){
array_push($cats2, $cat2);
echo "<div id=\"d2\" style=\"display:none;\">";
echo "<img src='images/laminate/Wilsonart_Laminate_Colors/$directory/$cat2' onclick='Another_Big_One(this)'></div>";
}
}
closedir($mydir2);
}
echo "</div>";
echo "</div>";
?>