pjax官网
单页跳过pjax
一般主题里会有exclude
,这是整个页面跳过pjax
1 | pjax: |
举例:跳过 test
页面
1 | pjax: |
div跳过pjax
butterfly 3.4.1
找到blog/node_modules/hexo-theme-butterfly/layout/includes/third-party/pjax.pug
selectors
对pjaxSelectors
,下面这些class、id,都是能跳过pjax。
1 | script. |
Next 8.1.0
找到blog/node_modules/hexo-theme-next/layout/_scripts/pjax.njk
selectors
下的class
都能跳过
1 | selectors: [ |
举例
butterfly
:<div class="js-pjax"></div>
Next
:<div class="pjax"></div>
JavaScript跳过pjax
butterfly 3.4.1
找到blog/node_modules/hexo-theme-butterfly/layout/includes/third-party/pjax.pug
document.querySelectorAll('script[data-pjax]')
的data-pjax
Next 8.1.0
找到blog/node_modules/hexo-theme-next/layout/_scripts/pjax.njk
document.querySelectorAll('script[data-pjax], .pjax script')
的data-pjax
举例
butterfly
:<script defer data-pjax src="/js/wow.js"></script>
next
:<script defer data-pjax src="/js/wow.js"></script>
参考
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Ln's Blog!
评论