jQuery手机幸运大转盘抽奖

来源:https://www.sucaihuo.com/js/584.html 2015-12-05 05:09浏览(2968) 收藏

分享一款绿色的微信手机抽奖模板,当然也支持手机浏览器,包括移动设备。微信里面的token是安全验证,程序验证请自行解决。
jQuery手机幸运大转盘抽奖
分类:抽奖 > 转盘 难易:中级
查看演示 下载资源 下载积分: 20 积分

点击抽奖判断各种提示

$("#inner").click(function() {
    if (running)
        return;
    if (count >= 3) {
        alert("您已经抽了 3 次奖。");
        return
    }
    if (prize != null) {
        alert("亲,你不能再参加本次活动了喔!下次再来吧~");
        return
    }
    $.ajax({url: "index.php", dataType: "json", data: {token: "o7MB9ji5fQRsE0ZoVAMU7SlnRyMI", ac: "activityuser", tid: "5", t: Math.random()}, beforeSend: function() {
            running = true;
            timer = setInterval(function() {
                i += 5;
                outter.style.webkitTransform = 'rotate(' + i + 'deg)';
                outter.style.MozTransform = 'rotate(' + i + 'deg)'
            }, 1)
        }, success: function(data) {
            if (data.error == "invalid") {
                alert("您已经抽了 3 次奖。");
                count = 3;
                clearInterval(timer);
                return
            }
            if (data.error == "getsn") {
                alert('本次活动你已经中过奖,本次只显示你上次抽奖结果!兑奖SN码为:' + data.sn);
                count = 3;
                clearInterval(timer);
                prize = data.prizetype;
                sncode = data.sn;
                start(prizeDeg[data.prizetype - 1]);
                return
            }
            if (data.success) {
                prize = data.prizetype;
                sncode = data.sn;
                start(prizeDeg[data.prizetype - 1])
            } else {
                prize = null;
                start()
            }
            running = false;
            count++
        }, error: function() {
            prize = null;
            start();
            running = false;
            count++
        }, timeout: 4000})
})
标签: 抽奖转盘微信
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2