添加鼠标点击特效
出处:https://www.cnblogs.com/huzixia/p/10388866.html
鼠标点击的时候出现 "双心心" 的效果, 如图所示:
设置步骤
点击博客园的 【管理】 → 【设置】 → 一直往下拉, 找到 【页首Html代码】,添加如下代码内容, 保存即可:
<script type="text/javascript"> /* 鼠标特效 */ var a_idx = 0; jQuery(document).ready(function($) { $("body").click(function(e) { var a = new Array("❤富强❤","❤民主❤","❤文明❤","❤和谐❤","❤自由❤","❤平等❤","❤公正❤","❤法治❤","❤爱国❤","❤敬业❤","❤诚信❤","❤友善❤"); var $i = $("<span></span>").text(a[a_idx]); a_idx = (a_idx + 1) % a.length; var x = e.pageX, y = e.pageY; $i.css({ "z-index": 999999999999999999999999999999999999999999999999999999999999999999999, "top": y - 20, "left": x, "position": "absolute", "font-weight": "bold", "color": "rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")" }); $("body").append($i); $i.animate({ "top": y - 180, "opacity": 0 }, 1500, function() { $i.remove(); }); }); }); </script>
再返回博客园的页面, 鼠标点击就有 “双心心” 的特效了啊。
添加鼠标粒子吸附特效
出处:https://www.cnblogs.com/huzixia/p/10388943.html
设置步骤
点击博客园的【管理】 → 【设置】 → 一直往下拉, 找到【页脚Html代码】,添加如下代码内容, 保存即可:
<script id="c_n_script" src="https://blog-static.cnblogs.com/files/xiaokang01/js.js" color="240,230,140" opacity="1" count="75" zindex="-2">
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
} else {
}
</script>
https://blog-static.cnblogs.com/files/xiaokang01/js.js 这是添加的文件的链接 color="240,230,140" 粒子的颜色设置 opacity="1" 粒子的透明度 count="75" 粒子的个数
再返回博客园的页面, 就有鼠标粒子吸附特效了啊。