DDR爱好者之家 Design By 杰米

本文实例为大家分享了js实现幸运抽奖九宫格大转盘效果,供大家参考,具体内容如下

基于javascript实现九宫格大转盘效果

实现代码:

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>九宫格大转盘</title>
 <style type="text/css">
/*reset*/
*{ padding:0; margin:0}
body{ height: 100%; width: 100%; font-size:12px; color:#333;}
ul{ list-style:none;}
/*demo*/
#lottery{width:400px;height:400px;margin:20px auto 0; position:relative;}
#lottery div{width:100px;height:100px;text-align:centerfont-size:24px;color:#333; float:left;}
#lottery .cent{ background:#C33;}
#lottery .lottery-unit-0{ background:#CC6;}
#lottery .lottery-unit-1{ background:#F99;}
#lottery .lottery-unit-2{ background:#CC6;}
#lottery .lottery-unit-3{ background:#F99;}
#lottery .lottery-unit-4{ background:#CC6;}
#lottery .lottery-unit-5{ background:#F99;}
#lottery .lottery-unit-6{ background:#CC6;}
#lottery .lottery-unit-7{ background:#F99;}
#lottery .lottery-unit-8{ background:#CC6;}
#lottery .lottery-unit-9{ background:#F99;}
#lottery .lottery-unit-10{ background:#CC6;}
#lottery .lottery-unit-11{ background:#F99;}

#lottery div.select{background:#F0F;}

#lottery .start{ position:absolute; left:100px; top:100px; height:200px; width:200px;background:#C33; font-size:30px; text-align:center; cursor:pointer; line-height:200px; color:#fff;}
</style>
</style>
</head>
<body> 
 <!--九宫格大转盘-->
 <div id="lottery">
 
 <div class="lottery-unit lottery-unit-0">1</div>
 <div class="lottery-unit lottery-unit-1">2</div>
 <div class="lottery-unit lottery-unit-2">3</div>
 <div class="lottery-unit lottery-unit-3">4</div>
 
 <div class="lottery-unit lottery-unit-11">12</div>  
 <div class="cent"></div>
 <div class="cent"></div>  
 <div class="lottery-unit lottery-unit-4">5</div>
 
 <div class="lottery-unit lottery-unit-10">11</div>  
 <div class="cent"></div>
 <div class="cent"></div>  
 <div class="lottery-unit lottery-unit-5">6</div>
 
 <div class="lottery-unit lottery-unit-9">10</div>
 <div class="lottery-unit lottery-unit-8">9</div>
 <div class="lottery-unit lottery-unit-7">8</div>
 <div class="lottery-unit lottery-unit-6">7</div>

 <div class="start" id="start">抽奖</div>
 </div>
</body>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.min.js">

以上就是本文的全部内容,希望对大家学习javascript程序设计有所帮助。

DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米