Hello. I have a piece of coding, yet for the life of me, I have no idea how to accomplish the next step.
I have a code that allows me to grab images from any folder I choose and then use them in a slideshow - it automatically recognizes the images as images (in other words, I don’t need to specify which images I want to use).
However, I do not understand how to dynamically use those pictures in my slideshow code:
[php]
<?php //path to directory to scan. $directory = "images/";//get all image files with a .jpg extension.
$images = glob("" . $directory . "*.jpg");
$imgs = '';
// create array
foreach($images as $image){ $imgs[] = "$image"; }
//shuffle array
shuffle($imgs);
//select first 20 images in randomized array
$imgs = array_slice($imgs, 0, 20);
?>
Where you see my php coding, usually you would have divisions of pictures. Right now, all it does is display the first image (with the rest underneath). Then, when it changes images, it just goes blank.
I will post my js code as well (in case this is of any help).
[code]$("#slideshow > div:gt(0)").hide();
setInterval(function() {
$(’#slideshow > div:first’)
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo(’#slideshow’);
}, 3000);[/code]