0
Guys I made a photo gallery a little big so I added an effect of slice
in it are 64 images in case when the site loads only appears 12 and when the user clicks on see more will appear 12 in 12 it works normally follows the script of the effect:
$(".images-spaces").slice(0, 12).show();
$("#loadMore-photos").on('click', function (e) {
e.preventDefault();
$(".images-spaces:hidden").slice(0, 12).slideDown();
if ($(".images-spaces:hidden").length == 0) {
$("#load").fadeOut('slow');
}
});
the problem is that all 64 images upload together with the site and to optimize this wanted it to load only the first 12 which are the ones I left showing initially and wanted the following images not to be loaded when accessing the site but only when I click on button to see more photos:
<li class="col-md-2 no-padding all deck images-spaces" data-src="assets/images/gallery/deck-05.jpg">
<a href="assets/images/gallery/deck-05.jpg">
<img class="img-responsive" src="assets/images/gallery/deck-05.jpg" alt="Deck" />
<div class="gallery-ecoresort-poster">
<p>Deck</p>
</div>
</a>
</li>
<a href="#" id="loadMore-photos">Ver mais fotos</a>
I would like to know if it is possible to do this with this current gallery that I have.
With help of PHP you can make pagination type
– user60252