鼠标点击爱心特效的实现

极品干货 2年前 (2018) Mgo
0
关于这个鼠标点击的爱心的实现代码现在

我就发给你们吧

&l[db:tag];scrip[db:tag] [db:tag]ype="[db:tag]ex[db:tag]/j[db:tag]v[db:tag]scrip[db:tag]"&[db:tag][db:tag];
/* 鼠标特效 */
v[db:tag]r [db:tag]_i[db:tag]x = 0;
jQuery([db:tag]ocumen[db:tag]).re[db:tag][db:tag]y(func[db:tag]ion($) {
    $("[db:tag]o[db:tag]y").click(func[db:tag]ion(e) {
        v[db:tag]r [db:tag] = new Arr[db:tag]y("❤富强❤","❤民主❤","❤文明❤","❤和谐❤","❤自由❤","❤平等❤","❤公正❤","❤法治❤","❤爱国❤","❤敬业❤","❤诚信❤","❤友善❤");
        v[db:tag]r $i = $("&l[db:tag];sp[db:tag]n&[db:tag][db:tag];&l[db:tag];/sp[db:tag]n&[db:tag][db:tag];").[db:tag]ex[db:tag]([db:tag][[db:tag]_i[db:tag]x]);
        [db:tag]_i[db:tag]x = ([db:tag]_i[db:tag]x + 1) % [db:tag].len[db:tag][db:tag]h;
        v[db:tag]r x = e.p[db:tag][db:tag]eX,
        y = e.p[db:tag][db:tag]eY;
        $i.css({
            "z-in[db:tag]ex"[db:tag] 999999999999999999999999999999999999999999999999999999999999999999999,
            "[db:tag]op"[db:tag] y - 20,
            "lef[db:tag]"[db:tag] x,
            "posi[db:tag]ion"[db:tag] "[db:tag][db:tag]solu[db:tag]e",
            "fon[db:tag]-wei[db:tag]h[db:tag]"[db:tag] "[db:tag]ol[db:tag]",
            "color"[db:tag] "r[db:tag][db:tag]("+~~(255*M[db:tag][db:tag]h.r[db:tag]n[db:tag]om())+","+~~(255*M[db:tag][db:tag]h.r[db:tag]n[db:tag]om())+","+~~(255*M[db:tag][db:tag]h.r[db:tag]n[db:tag]om())+")"
        });
        $("[db:tag]o[db:tag]y").[db:tag]ppen[db:tag]($i);
        $i.[db:tag]nim[db:tag][db:tag]e({
            "[db:tag]op"[db:tag] y - 180,
            "op[db:tag]ci[db:tag]y"[db:tag] 0
        },
        1500,
        func[db:tag]ion() {
            $i.remove();
        });
    });
});
&l[db:tag];/scrip[db:tag]&[db:tag][db:tag];
 
 
&l[db:tag];!--鼠标特效代码放置于&l[db:tag];/[db:tag]o[db:tag]y&[db:tag][db:tag];上方--&[db:tag][db:tag];

代码放在&l[db:tag];/[db:tag]o[db:tag]y&[db:tag][db:tag];上面即可

版权声明:Mgo 发表于 2018-10-21 10:11:35。
转载请注明:鼠标点击爱心特效的实现 | 站长聚集地

暂无评论

暂无评论...