鼠标点击特效_茜茜_前端开发者

<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 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 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>

 如果对你有帮助的话麻烦点个【推荐】~最好还可以follow一下我的GitHub~感谢观看!

» 本文来自:前端开发者 » 《鼠标点击特效_茜茜_前端开发者》
» 本文链接地址:https://www.rokub.com/73736.html
» 您也可以订阅本站:https://www.rokub.com
赞(0)
64K

评论 抢沙发

评论前必须登录!