js实现随机抽奖
前言
在前端的开发当中,我们肯定会遇到随机抽奖的需求。我们要怎么去实现呢?下面就来分享随机抽奖的JS代码,有需要的小伙伴可以复制到编译器当中运行查看效果。
随机抽奖的JS代码
#wrap{ text-align:center; width:500px; margin:100pxauto; position:relative; } #ul1{ width:303px; height:303px; margin:50pxauto; padding:0; border-top:1pxsolidblack; border-left:1pxsolidblack; } #ul1li{ float:left; border-right:1pxsolidblack; border-bottom:1pxsolidblack; list-style:none; width:100px; height:100px; line-height:100px; text-align:center; } #tooltips{ width:100%; height:100%; background-color:rgba(0,0,0,0.5); position:absolute; top:0; z-index:999; display:none; } #info.btnbutton{ background-color:#009f95; color:white; outline:none; font-size:10px; width:60px; height:30px; margin-left:300px; } #info.content{ height:120px; padding:20px; box-sizing:border-box; } 开始抽奖 鼠标 1000万 100优惠券 很遗憾 键盘 iPhoneX 很遗憾 迪拜10日游 很遗憾