在博客园的设置中可以看到「页首Html代码」这一项。
首先要申请 JS 权限,理由就是想要美化博客、设置鼠标点击特效等,自己补充。
「页首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>
我自己从 B 站、搜狗输入法的颜文字里复制的表情包,可以根据个人喜好设置鼠标点击后出现的字符图案。但是字符图案要尽量避免和代码的冲突。
也设置成这样:
new Array("●零●",”壹","贰","▲叁▲","■肆■","★伍★","陆","柒","捌","玖","拾","佰","仟","万","亿");
原文地址:https://www.cnblogs.com/lonelyWMW/p/11594084.html
时间: 2024-11-02 16:05:13