ApoorvSaxena / ApoorvSaxena/lozad.js

Images not loading (data-loaded tag is injected, but no src tag)

未关闭
#220 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
7.5k
派生
435
PR 合并指标
30 天内没有已合并 PR

描述

I have installed lozad.js, but no images are loaded. lozad.js has been installed through npm.

Here’s the JS code.

```
const observer = lozad('.lozad', {
load: function(el) {
console.log('Loading element');
console.log(el);
},
});
observer.observe();
```

And the HTML markup.

``

lozad.js is triggered. I get console logs with the right elements, and `data-loaded="true"` is injected in the appropriate `` tag. But no `src` is injected, no image is loaded.

The `` tag looks like this once lozad.js is triggered.

``

I am lost here, any idea?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。