0

i scandir my images path and create php array like this

$images[
'image1.jpg',
'image2.jpg',
'image3.jpg',
'image4.jpg',
'image5.jpg',
'image6.jpg',
'image7.jpg',
 .....
'image2500.jpg'
];
<?php foreach($images as $img) { ?>
<img src="path_to_my_image/<?=$img;?>">
<?php } ?>

When i start loop foreach my script working but so slow. I want to show part of images for example 100 and after when user scroll down in browser show more 100.How can i do this?

  • 1
    you need to use jQuery or javascrip to achieve this. check http://stackoverflow.com/questions/14035180/jquery-load-more-data-on-scroll – Agam Banga May 18 '17 at 07:29
  • Check this http://stackoverflow.com/questions/5117421/how-to-load-images-dynamically-or-lazily-when-users-scrolls-them-into-view – Matteo Errera May 18 '17 at 07:30

0 Answers0