最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

jquery年会抽奖程序_jquery

来源:动视网 责编:小采 时间:2020-11-27 21:01:51
文档

jquery年会抽奖程序_jquery

jquery年会抽奖程序_jquery:看了一下,传不了源代码,特粘帖html 代码如下: .center { text-align: center; height: auto; } .center span { font-size: 50px; font-weight: 900; line-height: 50px; } .center img { wid
推荐度:
导读jquery年会抽奖程序_jquery:看了一下,传不了源代码,特粘帖html 代码如下: .center { text-align: center; height: auto; } .center span { font-size: 50px; font-weight: 900; line-height: 50px; } .center img { wid
 看了一下,传不了源代码,特粘帖html
代码如下:












1















var time = 0;
var th = 9;
var two = 5;
var f =1;
var max = 122;
var t;
var zhong = new Array();
function sshow() {
$("#i_div").show();
$("#s_div").hide();
}
function wshow(e) {
var s_sum;
switch (e) {
case 0:
s_sum = th + two + f;
break;
case 1:
s_sum = th + two + f;
break;
case 2:
s_sum = th + two;
break;
case 3:
s_sum = th;
break;
}
if (zhong.length < s_sum) {
var cha = (s_sum) - (zhong.length);
alert("名额还差 "+cha.toString()+" 名");
return;
}
$("#i_div").hide();
$("#s_div").show();
var sdiv = $("#s_div");
sdiv.children().remove();
if (e == 0 || e == 3) {
var html = "


三等奖


";
sdiv.prepend(html);
for (var i = 0; i < th; i++) {
html = " ";
sdiv.prepend(html);
}
}
if (e == 0 || e == 2) {
html = "


二等奖


";
sdiv.prepend(html);
for (var i = (th); i < (th + two); i++) {
html = " ";
sdiv.prepend(html);
}
}
if (e == 0 || e == 1) {
html = "


一等奖


";
sdiv.prepend(html);
for (var i = (th + two); i < (th + two + f); i++) {
html = " ";
sdiv.prepend(html);
}
}
}
function addtime() {
if (time == max)
time =0;
time=time+1;
$("#chg").html(time);
$("#chg_img").attr("src", "Content/images/JPEG/1 (" +time+ ").jpg");
t = setTimeout("addtime()", 20);
}
function stoptime() {
clearTimeout(t);
while (chkzhong() == 1) {
}
zhong.push(time);
$("#chg_img").attr("src", "Content/images/JPEG/1 (" + time + ").jpg");
}
function chg() {
if (zhong.length == (th + two + f)) {
alert("抽奖名额已全,请查看");
return;
}
if ($("#chg").attr("atg") == "0") {
$("#chg").attr("atg", "1");
addtime();
} else {
$("#chg").attr("atg", "0");
stoptime();
if (zhong.length == (th )) {
alert("三等奖已经抽完 ");
return;
}
if (zhong.length == (th + two )) {
alert("二等奖已经抽完 ");
return;
}
if (zhong.length == (th + two + f )) {
alert("一等奖已经抽完");
return;
}
}
}
function chkzhong() {
for (var it in zhong) {
if (it == time) {
if (time == max)
time=0
time = time + 1;
return 1;
} else {
return 0;
}
}
}



文档

jquery年会抽奖程序_jquery

jquery年会抽奖程序_jquery:看了一下,传不了源代码,特粘帖html 代码如下: .center { text-align: center; height: auto; } .center span { font-size: 50px; font-weight: 900; line-height: 50px; } .center img { wid
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top