动态宠物级别显示系统
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>* {box-sizing: border-box;}.dv {width: 340px;height: 200px;line-height: 200px;font-size: 30px;font-weight: 700;text-align: center;background-color: #e6c89b;}body {font: 12px/1.5 '微软雅黑';color: #fff;background-color: #eee;}.colors div {width: 60px;height: 40px;line-height: 40px;float: left;margin: 5px;text-align: center;background-color: #ccc;}.colors div:first-child {margin-left: 0;background-color: #e6c89b;}/* .colors div:nth-child(2){background-color: skyblue;}.colors div:nth-child(3){background-color: purple;}.colors div:nth-child(4){background-color: orange;}.colors div:last-child {margin-right: 0;background-color: #ff7800;} */</style></head><body><div><button>开始抽取</button></div><div class="dv"></div><div class="colors"><div>武器-普通</div><div>武器-高级</div><div>武器-稀有</div><div>武器-史诗</div><div>武器-传说</div></div><!-- 作业要求:根据选中属性自动判断宠物级别 --><!-- 作业要求:每次选中一个属性时,间隔等待2秒 识别宠物中... --><!-- 作业要求:选中其中0个属性:宠物级别-普通 字体颜色#e6c89b--><!-- 作业要求:选中其中1个属性:宠物级别-高级 字体颜色skyblue--><!-- 作业要求:选中其中2个属性:宠物级别-稀有 字体颜色purple--><!-- 作业要求:选中其中3个属性:宠物级别-史诗 字体颜色orange--><!-- 作业要求:选中其中4个属性:宠物级别-传说 字体颜色#ff7800--><script src="js/jquery-1.10.2.min.js"></script> <script>$(function () {let weapon = ['武器-普通', '武器-高级', '武器-稀有', '武器-史诗', '武器-传说'];let bg = ['#e6c89b', 'skyblue', 'purple', 'orange', 'ff7800'];$('button').click(function () {let ran = parseInt(Math.random() * bg.length);let sum = -1; let num = 0;let timeId = setInterval(function () {sum++;if (sum == bg.length) {num++;sum = 0;}$('.dv').css('background-color', bg[sum]).text('获得' + weapon[sum] + '一把');$('.colors>div').css('background-color', '#ccc');$('.colors>div:eq(' + sum + ')').css('background-color', bg[sum]);if (num == 2 && sum == ran) {$('.colors>div').css('background-color', '#ccc');$('.colors>div:eq(' + ran + ')').css('background-color', bg[ran]);$('.dv').css('background-color', bg[ran]);clearInterval(timeId);}}, 240);});});</script>
</body>
</html>
相关知识
小动物视觉行为刺激动态跟踪系统
基于动态智能算法的宠物喂养方法及系统
动物感情显示系统和动物感情显示方法.pdf
宠物美容师的级别划分
宠物美容师分级别吗? 爱问知识人
宠物美容师有几个级别
集群动态
野外宠物对战怎么不显示了 NGA玩家社区
宠物伤害数字不显示 NGA玩家社区
宠物美容师分ABC级别,分别有什么要求? 爱问知识人
网址: 动态宠物级别显示系统 https://m.mcbbbk.com/newsview944511.html