看了一下,传不了源代码,特粘帖html 复制代码 代码如下: <BR>.center <BR>{ <BR>text-align: center; <BR>height: auto; <BR>} <BR>.center span <BR>{ <BR>font-size: 50px; <BR>font-weight: 900; <BR>line-height: 50px; <BR>} <BR>.center img <BR>{ <BR>width: 1200px; <BR>height: 580px; <BR>} <BR>.s_chg <BR>{ <BR>float: left; <BR>width: 1240px; <BR>height: auto; <BR>margin-left:40px; <BR>} <BR>.s_chg img <BR>{ <BR>width: 240px; <BR>height: 120px; <BR>padding-top:10px; <BR>} <BR>.s_title <BR>{ <BR>color:Red; <BR>font-size :35px; <BR>font-weight:bold; <BR>} <BR> 1 查看全部获奖 查看一等奖获奖 查看二等奖获奖 查看三等奖获奖 开始抽奖 <BR>var time = 0; <BR>var th = 9; <BR>var two = 5; <BR>var f =1; <BR>var max = 122; <BR>var t; <BR>var zhong = new Array(); <BR>function sshow() { <BR>$("#i_div").show(); <BR>$("#s_div").hide(); <BR>} <BR>function wshow(e) { <BR>var s_sum; <BR>switch (e) { <BR>case 0: <BR>s_sum = th + two + f; <BR>break; <BR>case 1: <BR>s_sum = th + two + f; <BR>break; <BR>case 2: <BR>s_sum = th + two; <BR>break; <BR>case 3: <BR>s_sum = th; <BR>break; <BR>} <BR>if (zhong.length < s_sum) { <BR>var cha = (s_sum) - (zhong.length); <BR>alert("名额还差 "+cha.toString()+" 名"); <BR>return; <BR>} <BR>$("#i_div").hide(); <BR>$("#s_div").show(); <BR>var sdiv = $("#s_div"); <BR>sdiv.children().remove(); <BR>if (e == 0 || e == 3) { <BR>var html = "<br/><br/><br/><span class='s_title'>三等奖<br/><br/><br/>"; <BR>sdiv.prepend(html); <BR>for (var i = 0; i < th; i++) { <BR>html = " <img src='Content/images/JPEG/1 (" + zhong[i] + ").jpg' / alt="jquery 年会抽奖程序_jquery" > "; <BR>sdiv.prepend(html); <BR>} <BR>} <BR>if (e == 0 || e == 2) { <BR>html = "<br/><br/><br/><span class='s_title'>二等奖<br/><br/><br/>"; <BR>sdiv.prepend(html); <BR>for (var i = (th); i < (th + two); i++) { <BR>html = " <img src='Content/images/JPEG/1 (" + zhong[i] + ").jpg' / alt="jquery 年会抽奖程序_jquery" > "; <BR>sdiv.prepend(html); <BR>} <BR>} <BR>if (e == 0 || e == 1) { <BR>html = "<br/><br/><br/><span class='s_title'>一等奖<br/><br/><br/>"; <BR>sdiv.prepend(html); <BR>for (var i = (th + two); i < (th + two + f); i++) { <BR>html = " <img src='Content/images/JPEG/1 (" + zhong[i] + ").jpg' / alt="jquery 年会抽奖程序_jquery" > "; <BR>sdiv.prepend(html); <BR>} <BR>} <BR>} <BR>function addtime() { <BR>if (time == max) <BR>time =0; <BR>time=time+1; <BR>$("#chg").html(time); <BR>$("#chg_img").attr("src", "Content/images/JPEG/1 (" +time+ ").jpg"); <BR>t = setTimeout("addtime()", 20); <BR>} <BR>function stoptime() { <BR>clearTimeout(t); <BR>while (chkzhong() == 1) { <BR>} <BR>zhong.push(time); <BR>$("#chg_img").attr("src", "Content/images/JPEG/1 (" + time + ").jpg"); <BR>} <BR>function chg() { <BR>if (zhong.length == (th + two + f)) { <BR>alert("抽奖名额已全,请查看"); <BR>return; <BR>} <BR>if ($("#chg").attr("atg") == "0") { <BR>$("#chg").attr("atg", "1"); <BR>addtime(); <BR>} else { <BR>$("#chg").attr("atg", "0"); <BR>stoptime(); <BR>if (zhong.length == (th )) { <BR>alert("三等奖已经抽完 "); <BR>return; <BR>} <BR>if (zhong.length == (th + two )) { <BR>alert("二等奖已经抽完 "); <BR>return; <BR>} <BR>if (zhong.length == (th + two + f )) { <BR>alert("一等奖已经抽完"); <BR>return; <BR>} <BR>} <BR>} <BR>function chkzhong() { <BR>for (var it in zhong) { <BR>if (it == time) { <BR>if (time == max) <BR>time=0 <BR>time = time + 1; <BR>return 1; <BR>} else { <BR>return 0; <BR>} <BR>} <BR>} <BR>