找传奇、传世资源到传世资源站!

asp.net mvc 大转盘抽奖示例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

asp.net mvc 大转盘抽奖示例源码 C#语言基础-第1张@{ ViewBag.Title = "抽奖"; Layout = null;}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>抽奖</title> <link href="~/Content/css/demo.css" rel="stylesheet" /></head><body> <div class="left"> <div class="turntable-bg"> <!--<div class="mask"><img src="images/award_01.png"></div>--> <div class="pointer"> <img id="rotate1" onclick="add()" src="~/Content/images/pointer.png" alt="pointer" /> </div> <div class="rotate"> <img id="rotate" src="~/Content/images/turntable.png" alt="turntable" /> </div> </div> </div></body></html><script src="~/Scripts/jquery-1.9.1.min.js"></script><script src="~/Scripts/jquery.min.js"></script><script src="~/Scripts/awardRotate.js"></script><script type="text/javascript"> function add() { $.ajax({ type: 'POST', url: '/Home/GetTbllist', dataType: 'json', cache: false, error: function () { alert('出错了!'); return false; }, success: function (data) { var angles = parseInt(data.angle); //角度 var txt = data.prize; //奖项 var awards = parseInt(data.id); var bRotate = false; var rotateFn = rotateFn_method(awards, angles, txt); if (bRotate) return; switch (awards) { case 0: //var angle = [26, 88, 137, 185, 235, 287, 337]; rotateFn_method(0, 337, '10奖券'); break; case 1: //var angle = [88, 137, 185, 235, 287]; rotateFn_method(1, 26, '一等奖'); break; case 2: //var angle = [137, 185, 235, 287]; rotateFn_method(2, 88, '5奖券'); break; case 3: //var angle = [137, 185, 235, 287]; rotateFn_method(3, 137, '20奖券'); break; case 4: //var angle = [185, 235, 287]; rotateFn_method(4, 185, '三等奖'); break; case 5: //var angle = [185, 235, 287]; rotateFn_method(5, 235, '8奖券'); break; case 6: //var angle = [235, 287]; rotateFn_method(6, 235, '8奖券'); break; case 7: //var angle = [287]; rotateFn_method(7, 282, '二等奖'); break; } } }); } function rotateFn_method(awards, angles, txt) { var bRotate = false; bRotate = !bRotate; $('#rotate').stopRotate(); $('#rotate').rotate({ angle: 0, animateTo: angles 1800, duration: 8000, callback: function () { alert("恭喜你抽中" txt ""); bRotate = !bRotate; } }) };</script>

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复