{
    分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

jQuery手机移动端老虎机抽奖代码

jQuery手机移动端老虎机抽奖代码是一款好看的网站抽奖活动专题页面特效。


js代码

<script>
$(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>个金豆')
			});
		}
	});
});
</script>


在线预览
资源均来自第三方,谨慎下载,前往第三方网站下载


爱资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:jQuery手机移动端老虎机抽奖代码
喜欢 ()分享 (0)