js2

<div class="tr_left">
<img src="images/photo/pic_p1.jpg" alt=""  id="zhong"/>
</div>
<div class="tr_right">
<a href="#!" title="点击抽奖" class="btn_raff" id="check"><span>点击抽奖</span></a></div>
<div class="clear"></div>



 
	$(function(){
				$("#check").click(function(){
					if($("#churu").val()==""){
						alert("请输入号码(数字)");
						return false;
					}
					$("#zhong").attr("src","images/photo/pic_p2.gif");
					//loadPopup('msgbox');
					setTimeout(function(){
						$.ajax({
							   type: "POST",
							   url: "check-no.action",
							   data: "num="+$("#churu").val(),
							   dataType:"html",
							   cache: false,
							   success: function(msg){					  
							if(msg=='2'){
								$("#zhong").attr("src","images/photo/pic_p3.jpg");
								loadPopup('msgbox2');
							}else if(msg=='0'){
								$("#zhong").attr("src","images/photo/pic_p3.jpg");
								loadPopup('msgbox1');
							}else if(msg=='1'){
								$("#zhong").attr("src","images/photo/pic_p3.jpg");
								loadPopup('msgbox3');
							}else{
								$("#tiao").attr("href","userform.action?num="+msg);
								$("#zhong").attr("src","images/photo/pic_p1.jpg");
								$("#cc").html(msg);
								loadPopup('msgbox');
								$("#tiaozhuang").val(msg);
								$("#jishi").html("7");
																}	
							   }
							}); },3000);


					});


			})
			
	function daojishi(){
		var djs =$("#jishi")[0];
	     if(djs.innerHTML == 0){

	          window.location.href="userform.action?num="+$("#tiaozhuang").val();	

	          return false;

	     }

	     djs.innerHTML = djs.innerHTML - 1;

	}
		
		
		  window.setInterval("daojishi()", 1000);

			</script>
	</head>
 

你可能感兴趣的:(js)