Update: After much confusion it turns out that the issue was in my stylesheet. Both of the sliders were in fact loading, however, the positioning caused them to overlap, hiding the second (or any additional) sliders.
I've been attempting to create two instances of this jQuery slider that uses images from a specific directory. Folders are generated by a different script and contain 18 images each. It appears that only the first slider works.
You can view a live example of this issue here.
The jQuery is pretty straight-forward, however, please note that I'm still learning PHP, however I've been able to list folders within my main directory and create what would be the correct markup for multiple sliders.
<?php
$a = 0;
$b = 0;
$c = 0;
if ($handle = opendir('.')) {
$blacklist = array('.', '..', 'frames', 'carbon_fibre.png', 'panel.png', 'sort.php', 'squares.png', 'test.php', 'test.txt', '360logo.png', '.DS_Store', 'js');
while (false !== ($file = readdir($handle))) {
if (!in_array($file, $blacklist)) {
echo "<div id='". ++$a ."'>". ++$b ."</div>";
echo "<br>";
echo "<script>
$('#". ++$c ."').directorySlider({
animation: 'fade',
filebase: 'a',
directory: '".$file."/',
extension: 'jpg',
numslides: 18,
height: 200,
timeout: 100,
speed: 100
});
</script><br>";
}
}
closedir($handle);
}
?>
The output of this script is:
<div id='1'>1</div><br><script>
$('#1').directorySlider({
animation: 'fade',
filebase: 'a',
directory: '20140529-1740/',
extension: 'jpg',
numslides: 18,
height: 200,
timeout: 100,
speed: 100
});
</script><br><div id='2'>2</div><br><script>
$('#2').directorySlider({
animation: 'fade',
filebase: 'a',
directory: '20140529-1751/',
extension: 'jpg',
numslides: 18,
height: 200,
timeout: 100,
speed: 100
});
</script>
The output seems to be correct, it correctly lists my directories in the scripts, but I still only see the first slider working. I should mention that these directories are generated automatically and are titled by the the date and time of creation.
Please let me know if you have any advice or insight as to why I'm experiencing this issue. I'm more than happy to provide more information. I really do appreciate your time.