<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html" charset="UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<link rel="stylesheet" href="style/reset.css">
<link rel="stylesheet" href="style/style.css">
<title>jquery幸运大转盘</title>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
! function (t) {
var e = 750,
i = t.document,
n = i.documentElement,
o = "orientationchange" in t ? "orientationchange" : "resize",
a = function t() {
var i = n.getBoundingClientRect().width;
return n.style.fontSize = 5 * Math.max(Math.min(i / e * 20, 11.2), 8.55) + "px", t
}();
n.setAttribute("data-dpr", t.navigator.appVersion.match(/iphone/gi) ? t.devicePixelRatio : 1),
/iP(hone|od|ad)/.test(
t.navigator.userAgent) && (i.documentElement.classList.add("ios"), parseInt(t.navigator.appVersion
.match(
/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8 && i.documentElement.classList.add("hairline")), i.addEventListener &&
(t.addEventListener(
o, a, !1), i.addEventListener("DOMContentLoaded", a, !1))
}(window);
</script>
</head>
<body>
<div class="demo">
<div class="pan">
<div id="disk"></div>
<div id="start"> <img id="startbtn" src="images/point.png" width="100%"> </div>
</div>
<div class="rules">
<div class="tit"> 抽奖规则 </div>
<p> 1、由于系统延迟如未获得抽奖机会请耐心等待</p>
<p>2、中奖结果以系统弹出的对话框信息为准</p>
<p>3、下单时间支付时间以京东充值系统时间为准</p>
<p> 4、活动当后一天建议23点30分前参与抽奖避免因充值成
功而抽奖活动已结束无法参加活动。</p>
</div>
</div>
<script type="text/javascript" src="js/jQueryRotate.2.2.js"></script>
<script type="text/javascript">
$(function () {
$("#startbtn").click(function () {
lottery();
});
});
function lottery() {
$.ajax({
type: 'POST',
url: 'ajax.asp',
dataType: 'json',
cache: false,
error: function () {
alert('出错了!');
return false;
},
success: function (json) {
$("#startbtn").unbind('click').css("cursor", "default");
var a = json.angle; //角度
var p = json.prize; //奖项
var zj=1800+parseInt(a);
$("#startbtn").rotate({
duration: 3000, //转动时间
angle: 0,
animateTo: zj, //转动角度
easing: $.easing.easeOutSine,
callback: function () {
var con = confirm('恭喜你,中得' + p + '\n还要再来一次吗?');
if (con) {
lottery();
} else {
//再次绑定click事件
$("#startbtn").css("cursor", "pointer").on("click", function () {
lottery();
});
return false;
}
}
});
}
});
}
</script>
</body>
</html>