Simplified the lazy loading of post images.

This commit is contained in:
Cotes Chung
2020-05-01 02:18:04 +08:00
parent 7b3e0f741a
commit e561dfb9be
4 changed files with 19 additions and 25 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
<!-- image lazy load -->
<!-- image lazy load: https://github.com/ApoorvSaxena/lozad.js -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
<script type="text/javascript">
const observer = lozad();
const el = document.querySelectorAll('#post-wrapper img');
const observer = lozad(el);
observer.observe();
</script>