Skip to content

Commit a61ba2f

Browse files
committed
more attempts at Lazy loading
1 parent 22a9145 commit a61ba2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gallery.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var s3 = new AWS.S3({
2525
viewAlbum('bh6');
2626
// viewAlbum('bh5');
2727

28-
$('.image').lazy();
28+
$('.image').Lazy();
2929

3030
// Used to create HTML for our images
3131
function getHtml(template) {
@@ -49,7 +49,7 @@ function viewAlbum(albumName) {
4949
return;
5050
}
5151
return getHtml([
52-
'<div class="image" style="background-image: url(' + photoUrl + ');" data-url="' + photoUrl + '"></div>',
52+
'<div class="image" style="background-image: url(' + photoUrl + ');" data-src="' + photoUrl + '"></div>',
5353
]);
5454
});
5555
document.getElementById(albumName).innerHTML = getHtml(photos);
@@ -61,7 +61,7 @@ $(document).on('click', function(event) {
6161
if ($(event.target).attr('class') == 'image') {
6262
$('#modal').show();
6363
var top = 'calc(5% + ' + (window.scrollY) + 'px)';
64-
$('#modal-img').attr('src', $(event.target).attr('data-url'));
64+
$('#modal-img').attr('src', $(event.target).attr('data-src'));
6565
$('#modal').css('top', top);
6666
$('#modal-background').show();
6767
}

0 commit comments

Comments
 (0)