🌟博客园鼠标点击特效

一.效果图

二.打开博客后台管理

三.复制下面代码到页首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>

**当然点击事件的文字是可以更换的

鼠标点击小水珠特效

可以放在页脚

<!--鼠标特效-->
<script src="https://blog-static.cnblogs.com/files/zouwangblog/mouse-click.js"></script>
<canvas width="1777" height="841" style="position: fixed; left: 0px; top: 0px; z-index: 2147483647; pointer-events: none;"></canvas>
<!--鼠标特效 end-->
posted @ 2020-09-25 19:40  给你骨质唱疏松  阅读(262)  评论(5编辑  收藏  举报