jquery砸金蛋 高仿阿里旅游砸金蛋

下面是编程之家 jb51.cc 通过网络收集整理的代码片段。

编程之家小编现在分享给大家,也给大家做个参考。

function zadan(obj) {

    $(obj).children("span").hide();

    eggClick($(obj));

};

function donghua() {

    $("#hammer").animate({

        top : "150px",left : "420px"

    },1000);

    $("#hammer").animate({

        top : "110px",left : "455px"

    },1000);

 

}

var dingshi = setInterval("donghua()",2000);

var dansui = 1;

function eggClick(obj) {

 

    if (dansui == 0) {

        alert("蛋都碎掉了");

        return;

    }

 

    $("#hammer").stop(true);

    clearInterval(dingshi);

    var _this = obj;

 

    $(".hammer").css({

        "top" : "170px","left" : "420px"

    });

    setTimeout(function () {

        _this.addClass("curr"); //蛋碎效果

        _this.find("sup").show(); //金花四溅

        $(".hammer").hide(); //隐藏锤子

        $('.resultTip').css({

            display : 'block',top : '280px',left : '315px',opacity : 0

        }).animate({

            top : '240px',opacity : 1

        },300,function () {

            dansui = 0;

            $("#result").html("恭喜,您中得" + rs.data.prize);

 

        })

    },300);

 

}


以上是编程之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...