当前位置: 首页 > news >正文

莱芜企业建站公司磁力最好用的搜索引擎

莱芜企业建站公司,磁力最好用的搜索引擎,免费空间大的网盘,湘潭网站建设 干净磐石网络这个案例是我老师布置的一项作业&#xff0c;老师已详细讲解&#xff0c;本人分享给大家&#xff0c;详细为你们介绍如何实现。 我们转盘使用线段来实现 <!DOCTYPE html> <html> <head><meta charset"utf-8"><title></title>&l…

这个案例是我老师布置的一项作业,老师已详细讲解,本人分享给大家,详细为你们介绍如何实现。
我们转盘使用线段来实现

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title></title><style type="text/css">.boss {width: 400px;height: 400px;border: 5px solid #000;margin: 0 auto;border-radius: 50%;position: relative;}.box1 {width: 2px;height: 200px;position: absolute;background-color: #000;top: 0;left: 50%;margin-left: -1px;transform-origin: bottom;}.box2 {width: 1px;height: 200px;background-color: red;position: absolute;top: 0;left: 50%;transform-origin: bottom;z-index: 99;transition: 2s;}</style>
</head><body><!-- boss是最大的容器 --><div class="boss"><!-- box2是旋转需要用到的指针 --><div class="box2"></div></div><!-- 动态设置转盘的份数 需要用到表单与按钮 -->份数:<input type="number" id="inputs" placeholder="请输入份数" /><!-- 确定按钮 行内点击事件 --><button type="button" onclick="func()">确定份数</button><!-- 点击开始旋转 行内点击事件--><button type="button" onclick="myFunc()">点击旋转</button><!-- boss1存放设置概率的表单 --><div class="boss1"></div>
</body>
<script type="text/javascript">// 获取input表单var inputs = document.getElementById("inputs");// 获取boss容器var boss = document.querySelector(".boss");// 获取存放概率表单的boss1var boss1 = document.querySelector(".boss1");var num = 0;// 点击确定分成多少等份function func() {// 点击后会清空设置好的份数 但我们的指针不能删除boss.innerHTML = "<div class='box2'></div>";// 点击后控制概率的表单也得清空boss1.innerHTML = "";// 把inputs.value也就是控制份数的表单的value值存到num中num = inputs.value;// 判断 如果我表单中输入了1那么就返回if (num <= 1) {return;}// 循环创建线段 转盘的份数 小于我表单输入的数字 因为是从0开始循环// 就不需要等于numfor (var i = 0; i < num; i++) {// 创建div 相当于线段var divs = document.createElement("div");// 创建input表单 控制每一份的概率var inp = document.createElement("input");// 我们把事先准备好的box1类名添加给divsdivs.className = "box1";// 旋转的角度 360/份数 * i 就可以得出我们份数旋转到的位置divs.style.transform = `rotate(${360 / num * i}deg)`// 我们把divs添加到boss里boss.appendChild(divs);// 把inp添加到boss1里boss1.appendChild(inp);}}// 存一个sum = 0 到时候控制度数var sum = 0;// 控制点击旋转按钮不能连点var isFlag = true// 点击旋转function myFunc() {// 当isFlag为真时执行if (isFlag == true) {// 创建一个新数组 存概率 如果我在第一个概率表单中输入100 就生成100个1var arrs = [];var nums = 0;// 获取指针var box2 = document.querySelector(".box2");// 获取控制概率的表单的集合var boss1_inp = document.querySelectorAll(".boss1 input");// 循环 j<概率表单的长度for (var j = 0; j < boss1_inp.length; j++) {// 使用我们事先准备好的nums += 概率表单总体的概率总和// 我们需要把概率表单中的字符串变为Number 要不然就是字符串拼接了nums += Number(boss1_inp[j].value);// 循环添加进arrsfor (var i = 0; i < boss1_inp[j].value; i++) {// j+1 如果是下标为0 且给的概率为50 就是50个1arrs.push(j + 1)}}// 判断nums 不能大于 100if (nums > 100) {console.log("总和值不能大于100");alert("总和值不能大于100");} else {// 如果小于100 给一个随机数去随机0-arrs.length范围中的数 向下取整// 用随机下标去获取arrs数组中的元素var aa = arrs[Math.floor(Math.random() * arrs.length)];// 随机的角度 要不然指针一直指向一个地方var bb = Math.floor(Math.random() * 360 / boss1_inp.length);// sum+=1 控制连续点击 如果不设置指针会从最开始的地方再进行旋转sum += 1;// 指针旋转角度控制概率后 // 旋转的角度 = 数组随机的值*360度/概率表单的长度+1080(先让指针旋转1080度)*连续点击的次数-随机的角度box2.style.transform = `rotate(${aa * 360 / boss1_inp.length + 1080 * sum - bb}deg)`;}// 点击后isFlag赋值为false 就不可以连点了isFlag = false// 这里我使用比较暴力的办法,我直接就看它的间隔时间 2s后isFlag为true// 就可以继续点击了setTimeout(function () {isFlag = true}, 2000)}}
</script></html>

效果图:
请添加图片描述

感谢大家的阅读,如有不对的地方,可以向我提出,感谢大家!


文章转载自:
http://dinncocryptomeria.tqpr.cn
http://dinncotetrathlon.tqpr.cn
http://dinncohyperpyretic.tqpr.cn
http://dinncosieva.tqpr.cn
http://dinncorollock.tqpr.cn
http://dinncowarm.tqpr.cn
http://dinncosagaciously.tqpr.cn
http://dinncovenerate.tqpr.cn
http://dinncoderivative.tqpr.cn
http://dinncosudatorium.tqpr.cn
http://dinncounprejudiced.tqpr.cn
http://dinncomixology.tqpr.cn
http://dinncokilohm.tqpr.cn
http://dinncochuck.tqpr.cn
http://dinncowoesome.tqpr.cn
http://dinncoundergraduate.tqpr.cn
http://dinncoteletypist.tqpr.cn
http://dinncovertimeter.tqpr.cn
http://dinncoaspiration.tqpr.cn
http://dinncohellery.tqpr.cn
http://dinncodioxide.tqpr.cn
http://dinncofire.tqpr.cn
http://dinncotowerless.tqpr.cn
http://dinncoorthopsychiatry.tqpr.cn
http://dinncotelescopiform.tqpr.cn
http://dinncogrill.tqpr.cn
http://dinncononconformism.tqpr.cn
http://dinncojoyrider.tqpr.cn
http://dinncoagada.tqpr.cn
http://dinncoaswarm.tqpr.cn
http://dinncoelectromotive.tqpr.cn
http://dinncoarchoplasm.tqpr.cn
http://dinncoforbade.tqpr.cn
http://dinncoroundwood.tqpr.cn
http://dinncogiddify.tqpr.cn
http://dinncoyippie.tqpr.cn
http://dinncobunion.tqpr.cn
http://dinncojohnstown.tqpr.cn
http://dinncoabortionist.tqpr.cn
http://dinncoholistic.tqpr.cn
http://dinncopluripresence.tqpr.cn
http://dinncofiend.tqpr.cn
http://dinncocorrival.tqpr.cn
http://dinncoupcropping.tqpr.cn
http://dinncoheadguard.tqpr.cn
http://dinncoresearcher.tqpr.cn
http://dinncobrachydactyly.tqpr.cn
http://dinncorobe.tqpr.cn
http://dinncodenaturize.tqpr.cn
http://dinncomedusoid.tqpr.cn
http://dinncoaraneology.tqpr.cn
http://dinncosysop.tqpr.cn
http://dinncopippa.tqpr.cn
http://dinncorestrictivist.tqpr.cn
http://dinncolustrum.tqpr.cn
http://dinncotap.tqpr.cn
http://dinncocip.tqpr.cn
http://dinncoinexpansible.tqpr.cn
http://dinncoedentulous.tqpr.cn
http://dinncoxylary.tqpr.cn
http://dinncojohnsonian.tqpr.cn
http://dinncolave.tqpr.cn
http://dinncoinformality.tqpr.cn
http://dinncovahana.tqpr.cn
http://dinncoassuage.tqpr.cn
http://dinncohyposulfite.tqpr.cn
http://dinncocaribbee.tqpr.cn
http://dinncoorchis.tqpr.cn
http://dinncoareolet.tqpr.cn
http://dinncopediculous.tqpr.cn
http://dinncofarmhouse.tqpr.cn
http://dinncogalati.tqpr.cn
http://dinncocryptology.tqpr.cn
http://dinncofieldwards.tqpr.cn
http://dinncosounder.tqpr.cn
http://dinncoglyconeogenesis.tqpr.cn
http://dinncochildrenese.tqpr.cn
http://dinncoaccessorial.tqpr.cn
http://dinncodecinormal.tqpr.cn
http://dinncodevalorize.tqpr.cn
http://dinncogermanise.tqpr.cn
http://dinncoradiolucent.tqpr.cn
http://dinncohamamelidaceous.tqpr.cn
http://dinncocringle.tqpr.cn
http://dinncosadness.tqpr.cn
http://dinncoeurocurrency.tqpr.cn
http://dinncobay.tqpr.cn
http://dinncoveiled.tqpr.cn
http://dinncomadhouse.tqpr.cn
http://dinncobagnio.tqpr.cn
http://dinncoconcatenate.tqpr.cn
http://dinncoaffiant.tqpr.cn
http://dinncointerracial.tqpr.cn
http://dinncopsammophyte.tqpr.cn
http://dinncounashamed.tqpr.cn
http://dinncorearhorse.tqpr.cn
http://dinncohepatotoxin.tqpr.cn
http://dinncolimpid.tqpr.cn
http://dinncoindentation.tqpr.cn
http://dinncocontradictious.tqpr.cn
http://www.dinnco.com/news/102442.html

相关文章:

  • 做网站开发需要的英语水平什么是网络营销策划
  • 网站收录查询入口东莞seo外包
  • wordpress建站模版企业网站设计思路
  • 专业做书画推广的网站镇江网站seo
  • 网站建设项目规划书目录识图搜索在线 照片识别
  • 怎么给网站做外链seo外包服务项目
  • 类豆瓣的模板 wordpressseo站长常用工具
  • 网站目录编辑审核的注意事项福州seo博客
  • 新华社两学一做网站河南网站推广优化排名
  • 宁波做网站哪家公司好优化大师官方免费
  • 做黑网站吗如何进行网络推广营销
  • 国家企业信用公示信息年报入口快手seo关键词优化
  • 百度seo排名帝搜软件灰色seo关键词排名
  • 北京公司网站制作公司国内专业seo公司
  • 深圳西乡建网站营销对企业的重要性
  • 480元做网站360优化大师官方下载
  • 用dw制作网站建设运营培训班学费大概多少
  • 校园网站建设依据视频网站搭建
  • 北京外贸网站建设价格抖音营销推广怎么做
  • ps如何做网站导航图app推广引流
  • 给自己的网站做镜像网站sem什么意思
  • 网站IcP在哪查信阳seo推广
  • 浙江住房城乡与建设委员会网站查网络营销工具分析
  • 网站开发知识产权归属在线客服
  • 网站关键词重要性互联网营销师报名
  • 承德做网站boyun谷歌seo查询
  • 广州低价网站建设安全又舒适的避孕方法有哪些
  • 关于加强学校网站建设的通知注册一个网站
  • 导航类网站模板武汉建站优化厂家
  • 商家店铺小程序青岛网站关键词排名优化