php jQuery 年会抽奖,jquery 年会抽奖程序

看了一下,传不了源代码,特粘帖html

.center

{

text-align: center;

height: auto;

}

.center span

{

font-size: 50px;

font-weight: 900;

line-height: 50px;

}

.center img

{

width: 1200px;

height: 580px;

}

.s_chg

{

float: left;

width: 1240px;

height: auto;

margin-left:40px;

}

.s_chg img

{

width: 240px;

height: 120px;

padding-top:10px;

}

.s_title

{

color:Red;

font-size :35px;

font-weight:bold;

}

1

1%20(1).jpg

查看全部获奖

查看一等奖获奖

查看二等奖获奖

查看三等奖获奖

开始抽奖

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 = " 1%20(%22%20+%20zhong%5Bi%5D%20+%20%22).jpg ";

sdiv.prepend(html);

}

}

if (e == 0 || e == 2) {

html = "二等奖
";

sdiv.prepend(html);

for (var i = (th); i < (th + two); i++) {

html = " 1%20(%22%20+%20zhong%5Bi%5D%20+%20%22).jpg ";

sdiv.prepend(html);

}

}

if (e == 0 || e == 1) {

html = "一等奖
";

sdiv.prepend(html);

for (var i = (th + two); i < (th + two + f); i++) {

html = " 1%20(%22%20+%20zhong%5Bi%5D%20+%20%22).jpg ";

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;

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值