jquery 抽奖小程序实现代码

用jquery实现抽奖小程序

这些日子,到处都可以看到关于微信小程序的新闻或报到,在博客园中写关于微信小程序的也不少。但是今天我要说的不是微信小程序,而是用简单的jquery写的一个好玩的抽奖小程序。最后介绍了后面关于抽奖小程序的一些后面更新的方向和Math.random的一些小知识。(最终结果保存在:,点击可查看效果)

下面先看一个简单的抽奖小程序的例子:

html:

css:

rush:xml;"> *{margin: 0; padding: 0;} .g-lottery-Box { width: 400px; height: 400px; margin-left: 30px; position: relative; background: url(images/0.gif) no-repeat; margin: 0 auto; }

.g-lottery-Box .g-lottery-img {
width: 340px;
height: 340px;
position: relative;
background: url(images/1.png) no-repeat;
left: 30px;
top: 30px;
}

.g-lottery-Box #clik {
width: 186px;
height: 186px;
position: absolute;
top: 77px;
left: 77px;
background: url(images/2.png) no-repeat;
}

js:

rush:js;"> /* 注意引用的顺序 * *