Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazyload option seems not to work #266

Closed
njzjz opened this issue May 1, 2021 · 4 comments
Closed

lazyload option seems not to work #266

njzjz opened this issue May 1, 2021 · 4 comments
Labels
Invalid This doesn't seem right

Comments

@njzjz
Copy link
Member

njzjz commented May 1, 2021

The lozad.js needs an extra script to make it work. However, it seems that we don't have that script.

const el = document.querySelector('img');
const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
observer.observe();

The original PR iissnan/hexo-theme-next#269 had that script and I don't know when it disappeared...

NexT Configuration

lazyload: true
@njzjz njzjz added the Bug Something isn't working label May 1, 2021
@stevenjoezhang
Copy link
Member

Like this?

CONFIG.lazyload && window.lozad('.post-body img').observe();

@njzjz
Copy link
Member Author

njzjz commented May 1, 2021

Well, I found the reason... Just forget it!

@njzjz njzjz closed this as completed May 1, 2021
@njzjz njzjz added Invalid This doesn't seem right and removed Bug Something isn't working labels May 1, 2021
@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented May 2, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants