jquery老虎机抽奖小程序 3个数字滚动

jquery老虎机抽奖小程序 3个数字滚动2371
相关代码
$(".main3-btn").click(function () {		if(!flag){			flag=true;			reset();			letGo();			setTimeout(function () {				flag=false;				if(index==2){					$(".fix,.pop-form").show();				}else{					$(".fix,.pop").show();					$(".pop-text span").text(""+String(4-TextNum1)+(8-TextNum2))				}			},4000);			index++;		}	});	var flag=false;	var index=0;	var TextNum1	var TextNum2	var TextNum3	function letGo(){		TextNum1=parseInt(Math.random()*4)//随机数		TextNum2=parseInt(Math.random()*7)		TextNum3=parseInt(Math.random()*7)		var num1=[-549,-668,-786,-904][TextNum1];//在这里随机		var num2=[-1377,-1495,-1614,-430,-549,-668,-786,-904][TextNum2];		var num3=[-1377,-1495,-1614,-430,-549,-668,-786,-904][TextNum3];		$(".num-con1").animate({"top":-1140},1000,"linear", function () {			$(this).css("top",0).animate({"top":num1},1000,"linear");		});		$(".num-con2").animate({"top":-1140},1000,"linear", function () {			$(this).css("top",0).animate({"top":num2},1800,"linear");		});		$(".num-con3").animate({"top":-1140},1000,"linear", function () {			$(this).css("top",0).animate({"top":num3},1300,"linear");		});	}	function reset(){		$(".num-con1,.num-con2,.num-con3").css({"top":-430});	}

也许你还喜欢