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});
	}
      立即下载 ( 文件大小:0.36 M)

    浏览器兼容性

    1. IE 7
    2. IE 8
    3. IE 9
    4. Mozilla Firefox
    5. Google Chrome
    6. Oper
    7. Safari

    技术讨论区(由于垃圾评论太多,已关闭评论功能)

    1. 大爱无疆2

      大爱无疆

      怎么下载啊

      2017-6-18 23:11:16| 回复

    2. my broken heart1

      my broken heart

      听说评论可以收藏 0.0

      2015-12-30 11:42:21| 回复

    键盘快捷键: 上一个 下一个