网页添加水波纹
刷新顶部查看效果
1.在\themes\butterfly\source\js目录下创建一个ripples.js文件,并将如下代码写入该文件:
1 2 3 4 5 6 7 8 9 10 11
| $(document).ready(function () { try { $("#page-header").ripples({ resolution: 512, dropRadius: 10, perturbance: 0.04, }); } catch (e) { $(".error").show().text(e); } });
|
加载配置文件
开启 pjax
1 2 3 4 5 6
| inject: head: bottom: - <script defer src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"></script> - <script defer data-pjax src="https://cdn.jsdelivr.net/gh/sirxemic/jquery.ripples/dist/jquery.ripples.js"></script> - <script defer data-pjax src="/js/ripples.js"></script>
|
未开启 pjax
1 2 3 4 5 6 7
| inject: head: bottom: - <script defer src="https://rmt.dogedoge.com/fetch/~/source/jsdelivr/npm/jquery@latest/dist/jquery.min.js"></script> - <script defer src="https://cdn.jsdelivr.net/gh/sirxemic/jquery.ripples/dist/jquery.ripples.js"></script> - <script defer src="/js/ripples.js"></script>
|