Hi I currently have a jquery image slider script that pulls images from a folder and shows them on a page.
Here is the webpage with the working image slider: http://iseeit.no/slidertest/
What I want and have been trying to figure out is to have 9 individual sliders on the same page, here is an example picture that shows how it should look like:
each of the grey boxes represents the sliders

Now I’ve been trying to make a new div for each slides, but I can’t figure out how to do it…
Here is the index.php script:
Slideshow
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="scripts/jquery.cycle.all.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#myslides').cycle({
fit: 1, pause: 2, timeout: 100
});
});
</script>
<link rel="stylesheet" href="styles/dynamicslides.css" type="text/css" media="screen" />
</head>
<body>
<?php
$directory = 'images/slideshow';
try {
// Styling for images
echo "<div id=\"myslides\">";
foreach ( new DirectoryIterator($directory) as $item ) {
if ($item->isFile()) {
$path = $directory . "/" . $item;
echo "<img src=\"" . $path . "\" />";
}
}
echo "</div>";
}
catch(Exception $e) {
echo 'No images found for this slideshow.<br />';
}
?>
</body>
</html>
Here is the CSS coding:
#myslides {
padding: -8px;
margin: -8px;
}
#myslides img {
}
So I was wondering how I would do this? I’ve tried to make a new div but I don’t hvae so much experience with php, so I don’t think I’m doing it right…
Would love to get some feedback and some help with this.
Here is all the files that has to do with the script:
http://iseeit.no/files/slidertest.rar
If I get your question right, then you have one working slider and want more of them on one page next to each other. If so then you can do it like so:
PHP:
And set the jQuery plugin for the slider on the class
myslideslike so:You can use
floatsto place the sliders next to each other. Best practice would be anulwith the sliders as anli. But i left it as andivfor now. You can get them next to each other with this CSS:Hope this helps!
update: example code to create 3×3
Output: