嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
砸金蛋被广泛应用于庆典活动、商家促销、电视娱乐等场合,它的趣味、悬念能迅速活跃现场气氛。同样,我们也可以将砸金蛋应用到WEB网站上,用于开展线上活动。本文将使用jQuery与PHP讲解如何实现一个WEB砸金蛋程序。
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("很遗憾,您没能中奖!"); } }); } ); }); }