My goal is go generate the following code when the user scrolls down:
<?php
// get all files
$imagesDir = 'uploads/';
$images = glob($imagesDir . '* {jpg,jpeg,png,gif,JPG,JPEG,PNG,GIG}', GLOB_BRACE);
$imagesCount = count($images);
for($i = 0 ; $i < $imagesCount ; $i++) {
// select image
$randomIndex = array_rand($images); // select image index
$file_title = $randomImage = $images[$randomIndex]; // use selected image
unset($images[$randomIndex]); // remove selected image
// print_r($images); // you can see what left in $images
// show image
}
?>
<li class="item-thumbs span3 img">
<!-- Fancybox - Gallery Enabled - Title - Full Image -->
<a class="hover-wrap fancybox" data-fancybox-group="gallery"
title="<?php echo $randomImage ?>" href="<?php echo $randomImage ?>">
<span class="overlay-img"></span>
<span class="overlay-img-thumb font-icon-plus"></span>
</a>
<!-- Thumb Image and Description -->
<img src="<?php echo $randomImage ?>" alt="{Failed To Load Item Description}">
</li>
This code is found inside a block. I want to generate random images and have them show up in a nicely formatted area. Right now, everything works except that I need this code to be automatically generated so more show up as the user scrolls...Just like Facebook loads more posts on the wall when you scroll down. I've tried many scripts but none of them worked for me.