Closed val3344 closed 3 years ago
使用 NexT 主题,页面加载完成后,会调用 NexT.boot.refresh() 方法对页面进行初始化,其中包含代码高亮、图片缩放、懒加载、外部链接处理等操作:
NexT.boot.refresh()
NexT.boot.refresh = function() { /** * Register JS handlers by condition option. * Need to add config option in Front-End at 'scripts/helpers/next-config.js' file. */ CONFIG.prism && window.Prism.highlightAll(); CONFIG.fancybox && NexT.utils.wrapImageWithFancyBox(); CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', { background: 'var(--content-bg-color)' }); CONFIG.lazyload && window.lozad('.post-body img').observe(); CONFIG.pangu && window.pangu.spacingPage(); CONFIG.exturl && NexT.utils.registerExtURL(); NexT.utils.registerCopyCode(); NexT.utils.registerTabsTag(); NexT.utils.registerActiveMenuItem(); NexT.utils.registerLangSelect(); NexT.utils.registerSidebarTOC(); NexT.utils.wrapTableWithBox(); NexT.utils.registerVideoIframe(); };
模板 html5 lazyload 代码,在解锁完成后,通过 window.NexT 判断是否使用了 NexT 主题,如果使用了,则调用 NexT.boot.refresh() 进行初始化。
window.NexT
Will be in v3.1.4. Thanks a lot!
修改原因
使用 NexT 主题,页面加载完成后,会调用
NexT.boot.refresh()
方法对页面进行初始化,其中包含代码高亮、图片缩放、懒加载、外部链接处理等操作:修改内容
模板 html5 lazyload 代码,在解锁完成后,通过
window.NexT
判断是否使用了 NexT 主题,如果使用了,则调用NexT.boot.refresh()
进行初始化。