Skip to content

Commit

Permalink
fix img lazy loading (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
URenko authored Jul 4, 2023
1 parent f9b7651 commit 333a1c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/js/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,11 @@ Reader.initInfiniteScrollView = function () {

Reader.pages.slice(1).forEach((source) => {
const img = new Image();
img.src = source;
img.id = `page-${Reader.pages.indexOf(source)}`;
img.loading = "lazy";
img.height = 800;
img.width = 600;
img.src = source;
$(img).addClass("reader-image");
$("#display").append(img);
observer.observe(img);
Expand Down

0 comments on commit 333a1c3

Please sign in to comment.