首页 > 网站 > WEB开发 > 正文

jquery之飘雪

2024-04-27 15:04:20
字体:
来源:转载
供稿:网友

var creatShow = $('<div class="div1">❄</div>');var setI;function downSnowClick() {    $("#downSnow").attr("disabled",true);    //❉❅❆✻✼❇❈❊✥✺    setI = setInterval(function () {        var cloneShow = creatShow.clone(true);        var winwidth = Math.floor($(document).width() * Math.random() + 1)        var winOutWidth = Math.floor($(document).width() * Math.random() + 1)        cloneShow.CSS({ "top": "-10px", "left": winwidth - 40, "font-size": Math.floor(35 * Math.random()) + 5 });        $("body").append(cloneShow);        cloneShow.animate({ "top": $(window).height() - 55, "left": winOutWidth - 40, "opacity": "0.0" }, 3000, function () {            cloneShow.remove();        });    }, 300);}function stopSnowClick() {    clearInterval(setI);    //$("#downSnow").removeAttr("disabled");    $("#downSnow").attr("disabled", false);}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表