I'm using lightgallery.js
(https://sachinchoolur.github.io/lightgallery.js) to develop my ASP.NET MVC project.
It seems ok to load some images which have a size of less than 1MB, but the problem here when I use about ~20 pictures (~2MB/picture), Light Gallery will load very slow.
Could you share with me some ideas to overcome this problem?
Thanks for reading.
Asked
Active
Viewed 1,131 times
0

Mehran Gharzi
- 136
- 1
- 10

Duong Nguyen
- 21
- 5
-
Please check this link http://jquery.eisbehr.de/lazy/example_basic-usage – jishan siddique Jan 04 '21 at 08:31
-
wow, it's easy to combine with lightgallery that I'm looking for. Thank you! – Duong Nguyen Jan 04 '21 at 09:28
1 Answers
1
Hi please check this example lazy load image.
For more detail please check the official link -> Click me
$(document).ready(function(){
$("ul.jsImageUl > li img").lazy({
effect: "fadeIn",
effectTime: 1000
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.lazy/1.7.3/jquery.lazy.min.js"></script>
<ul class="jsImageUl">
<li>
<a href="#"><img data-src="https://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" width="200" height="200" alt="" /></a>
</li>
<li>
<a href="#"><img data-src="https://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" width="200" height="200" alt="" /></a>
</li>
<li>
<a href="#"><img data-src="https://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" width="200" height="200" alt="" /></a>
</li>
</ul>

jishan siddique
- 1,848
- 2
- 12
- 23