移动端类似老虎机特效【原创

来源:https://www.sucaihuo.com/js/2956.html 2017-09-09 09:18浏览(1278) 收藏

基于jQuery的移动端类似老虎机特效,页面最大宽度768px,手机wap老虎机抽奖代码下载,抽奖后会弹出中奖信息弹出层
移动端类似老虎机特效
分类:抽奖 > 老虎机 难易:初级
查看演示 下载资源 下载积分: 50 积分
$(el).slots(u,random,function () {}); 
方法传入三个参数,1:盒子的高度,2:中奖的随机数:3:回调函数
//规则
$('.com-main .slots .rule').click(function() {

});

//抽奖切换
$('.com-main .slots ul li').each(function() {
    $(this).click(function() {
        if ($(this).hasClass('active')) {
            return false
        }
        $(this).addClass('active').siblings().removeClass('active');
        var type = $(this).attr('data-type');
        $(".com-main .slots dl dd").attr({'class': "fl " + type});
        $('.com-main .slots .play-btn').attr('data-type', type);
        if (type === 'gb') {
            $('.com-main .slots h3').html('50 钢镚/次');
        } else if (type === 'jd') {
            $('.com-main .slots h3').html('1 金豆/次')
        }
    });
});

//抽奖play按钮
$('.com-main .slots .play-btn').click(function() {
    var u = 160.4; //盒子的高度
    var random = '000';//中奖随机数 ,分解金豆获取钢镚'000','111','222',
    var _this = $(this);
    var type = $(this).attr('data-type');
    if (!_this.hasClass('active')) {
        _this.addClass('active');
        $(".com-main .slots dl dd").slots(u, random, function() {
            _this.removeClass('active'); //还有抽奖机会移除active
            $.giftWarm("恭喜你", '合成了<span>5</span>个金豆')
        });
    }
});
标签: 抽奖老虎机
声明:本文为原创文章,如需转载,请注明来源sucaihuo.com并保留原文链接:https://www.sucaihuo.com/js/2956.html
评论0
头像

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

1 2