hexo-theme-Nlvi icon indicating copy to clipboard operation
hexo-theme-Nlvi copied to clipboard

`$(...).lazylaod` is not a function

Open liurui39660 opened this issue 5 years ago • 6 comments

主题用的commit a226d89,没有任何魔改,win10和ubuntu 18.04下测试都是如此,nodejs 10.9,chrome 68

全局开启lazyload之后,当hexo s时在console里输出

jquery-3.2.1.min.js:2 jQuery.Deferred exception: $(...).lazylaod is not a function TypeError: $(...).lazylaod is not a function
    at nlvi.bootstrap (http://localhost:4000/script/src/nlvi.js:345:33)
    at HTMLDocument.<anonymous> (http://localhost:4000/script/bootstarp.js:4:7)
    at j (http://localhost:4000/script/lib/jquery/jquery-3.2.1.min.js:2:29999)
    at k (http://localhost:4000/script/lib/jquery/jquery-3.2.1.min.js:2:30313) undefined
r.Deferred.exceptionHook @ jquery-3.2.1.min.js:2
jquery-3.2.1.min.js:2 Uncaught TypeError: $(...).lazylaod is not a function
    at nlvi.bootstrap (nlvi.js:345)
    at HTMLDocument.<anonymous> (bootstarp.js:4)
    at j (jquery-3.2.1.min.js:2)
    at k (jquery-3.2.1.min.js:2)

换成截图大概是这个样子 image 然后各种图片就统统显示不出来了

npm ls --depth=0的部分输出

[email protected] E:\Temporary\Webstorm\Readme2
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

pdf倒是都很正常,也就装了这么一个多余的东西

还需要其他什么debug信息嘛?

liurui39660 avatar Aug 28 '18 23:08 liurui39660

感谢,第一次看到这么清晰的描述

这个问题估计是我这边代码的问题,尽快解决

colmugx avatar Aug 29 '18 00:08 colmugx

知道真相的我眼泪掉下来……

liurui39660 avatar Aug 29 '18 09:08 liurui39660

我也有锅,标题这么大我完全没看。

第一次看到这么清晰的描述结果是这个问题,可以载入史册了..

colmugx avatar Aug 29 '18 09:08 colmugx

刚刚测试了一下发现了新的问题

我的图片使用{% asset_img <filename> %}的方式加载

37826282-33af-4697-b613-b140c0d24830

注意到那个图片闪了一下然后消失了

消失后该元素在chrome里的代码为

<img class="lazy" data-src="http://192.168.28.193:3000/RA-CNN/Figure%202.jpg" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC">

在我能够及时按下Esc阻止图片消失的场合下,代码是这样

<img src="/RA-CNN/Figure%202.jpg">

不知道是哪里存在的问题


为什么issue没有reopen?reopen在哪里放着呢?

liurui39660 avatar Aug 29 '18 09:08 liurui39660

如果不用 lazyload 有没有问题?我没用过这种引用方式

colmugx avatar Aug 29 '18 10:08 colmugx

不使用lazyload的话不会出现这种情况,图片可以正常加载 这个方式hexo自身就支持的,所以可能有会有其他人也遇到同样的问题 文档链接:https://hexo.io/docs/asset-folders.html

liurui39660 avatar Aug 29 '18 10:08 liurui39660