分享

砸金蛋 抽奖 游戏 完整源码下载 有截图

 sidneyz1 2020-08-09
function eggClick(obj) {
    var _this = obj;
    $.getJSON("data.php",function(res){//ajax请求
        _this.unbind('click'); //解除click
        $(".hammer").css({"top":_this.position().top-55,"left":_this.position().left 185});
        $(".hammer").animate({//锤子动画
            "top":_this.position().top-25,
            "left":_this.position().left 125
            },30,function(){
                _this.addClass("curr"); //蛋碎效果
                _this.find("sup").show(); //金花四溅
                $(".hammer").hide();//隐藏锤子
                $('.resultTip').css({display:'block',top:'100px',left:_this.position().
                left 45,opacity:0})
                .animate({top: '50px',opacity:1},300,function(){//中奖结果动画
                    if(res.msg==1){//返回结果
                        $("#result").html("恭喜,您中得" res.prize "!");
                    }else{
                        $("#result").html("很遗憾,您没能中奖!");
                    }
                });    
            }
        );
    });
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约