mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-06-08 08:37:53 +00:00
Improve the selector for lazy loading images (fix #313)
When `page.dynamic_title` is set to false, the image will not be loaded
This commit is contained in:
parent
e84331b26a
commit
3f2d400f16
@ -4,7 +4,7 @@
|
|||||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const imgs = document.querySelectorAll('.post-content img');
|
const imgs = document.querySelectorAll('#main > div.row:first-child > div:first-child img');
|
||||||
const observer = lozad(imgs);
|
const observer = lozad(imgs);
|
||||||
observer.observe();
|
observer.observe();
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user