类似老虎机特效移动端网页源码

类似老虎机特效移动端网页源码

类似老虎机特效移动端网页源码

基于jQuery的移动端类似老虎机特效,手机wap老虎机抽奖代码下载,抽奖后会弹出中奖信息弹出层

源码介绍

$(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("恭喜你"'合成了5个金豆'
        }); 
    } 
});


分享到 :

发表评论

登录... 后才能评论