基本信息
源码名称:jquery 大转盘例子源码下载(亲测可用)
源码大小:0.15M
文件格式:.rar
开发语言:CSS
更新时间:2016-03-18
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 1 元×
微信扫码支付:1 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
大转盘,直接打开文件可能不执行,放到站点下后 打开 即可正常运行,亲测通过
大转盘,直接打开文件可能不执行,放到站点下后 打开 即可正常运行,亲测通过
<!DOCTYPE> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>转盘抽奖</title> <script src="js/jquery-1.11.0.min.js"></script> <script src="js/Rotate.js"></script> <style> *{padding:0; margin:0;} .lotteryMain{ width:100%; padding:20px 0; } .lotteryBg{ width:520px; height:520px; margin:0 auto; background:url(images/lotteryBg.jpg) no-repeat; position:relative; overflow:hidden;} #run{ width:153px; height:214px; position:absolute; left:50%; top:50%; margin-left:-76px; margin-top:-107px; z-index:1; transform:rotate(0deg); -ms-transform:rotate(0deg); } #btn_run{ width:125px; height:125px; background:url(images/btn_start.png) no-repeat; border:none; outline:none; position:absolute; left:50%; top:50%; margin-left:-62px; margin-top:-62px; z-index:2;cursor:pointer;} </style> </head> <body> <section class="lotteryMain"> <div class="lotteryBg"> <img id="run" src="images/start.png" /> <input id="btn_run" type="button" value="" /> </div> </section> <script> $(function(){ $("#btn_run").click(function(){ $("#btn_run").attr('disabled',true).css("cursor","default"); lottery(); }); }); function lottery(){ $.ajax({ type: 'get', url: 'json.js', dataType: 'json', cache: false, error: function(){return false;}, success:function(obj){ $("#run").rotate({ duration:3000, //转动时间 angle: 0, //默认角度 animateTo:360*6 obj.rotate, //转动角度 easing: $.easing.easeOutSine, callback: function(){ alert(obj.results); $("#btn_run").attr('disabled',false).css("cursor","pointer"); } }); } }); }; </script> </body> </html>