From b362916daa43f3c3611fb0a00bc29dc22c9f88ad Mon Sep 17 00:00:00 2001
From: weru <onewesh@gmail.com>
Date: Wed, 22 Jul 2020 16:38:12 +0000
Subject: [PATCH] add image lazy loading support

---
 assets/js/index.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/assets/js/index.js b/assets/js/index.js
index 265ba48..ffc8c5d 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -368,6 +368,15 @@
       });
     }
   })();
+
+  (function lazyLoadImages() {
+    const images = elems('img');
+    images.forEach(function(image){
+      // supported natively by most modern browsers. 
+      image.loading = "lazy";
+    });
+ })();
+
 }
 
 window.addEventListener('load', loadActions());

--
Gitblit v1.10.0