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

建立网站的关键是定位seo管理系统培训运营

建立网站的关键是定位,seo管理系统培训运营,东莞seo建站优化哪里好,做网站的项目实施方案效果 实现方式 计时器#xff1a;setTimeout或setInterval来计时。setInterval和 setTimeout 在某些情况下可能会出现计时不准确的情况。这通常是由于JavaScript的事件循环机制和其他代码执行所需的时间造成的。 问询#xff1a;通过getCurrentLight将每个状态的持续时间设置…效果 实现方式 计时器setTimeout或setInterval来计时。setInterval和 setTimeout 在某些情况下可能会出现计时不准确的情况。这通常是由于JavaScript的事件循环机制和其他代码执行所需的时间造成的。 问询通过getCurrentLight将每个状态的持续时间设置为精确的值并使用requestAnimationFrame来递归调用getCurrentLight函数我们可以更准确地控制交通灯的状态。 源码 index.html !DOCTYPE html htmlheadtitle交通灯/titlelink typetext/css relstyleSheet href./index.css //headbodydiv classtraffic-lightdiv classtraffic-containerdiv classlight green/divdiv classlight yellow/divdiv classlight red/div/divdiv classtime90/div/divscript typemoduleimport {TrafficLight} from ./TrafficLight.js;const time document.querySelector(.time);const trafficDom document.querySelector(.traffic-light);const light new TrafficLight({red:3,yellow:2,green:5,initial:red,});function raf(){requestAnimationFrame((){raf();const current light.getCurrentLight();time.textContent current.remain;trafficDom.className traffic-light ${current.color};console.log(current.color,current.remain);})}raf();/script/body /htmlindex.css * {margin: 0;padding: 0;box-sizing: border-box; }body{width: 100vw;height: 100vh;margin: 0;/* backgroud: #191c29 */background: #fff; }.traffic-light{width: 200px;margin: 10px auto;-webkit-box-flex: inherit;text-align: center; }.light{width: 20px;height: 20px;border-radius: 10px;display:inline-block;background-color: gray;margin: 10px auto; }.red .red{background-color: red; }.green .green{background-color: green; } .yellow .yellow{background-color: yellow; }.time{font-family: DS-Digital;font-size: 40px; }TrafficLight.js export class TrafficLight {constructor(options) {const {red 60,green 60,yellow 3,initial green,} options || {};this._colors {red:{seconds: red,next:yellow,},green:{seconds: green,next:yellow,},yellow:{seconds : yellow,},};this._switch(initial);}_switch(color){this._currentColor color;this._seconds this._colors[color].seconds;this._time Date.now();}_next(){if(this._currentColor red){this._colors.yellow.next green;} else if(this._currentColor green){this._colors.yellow.next red;} else{}this._switch(this._colors[this._currentColor].next); }getCurrentLight(){const remain Math.ceil(this._seconds -(Date.now() - this._time)/1000);if(remain0){this._next();return this.getCurrentLight();}return {color: this._currentColor,remain,};}}字体 DS-Digital 下载字体 DS-Digital 注意下载安装字体后需要重启浏览器才生效
http://wiki.neutronadmin.com/news/204969/

相关文章:

  • 手机端网站html好看的单页模板wordpress分类目录下文章过多_添加文章目录导航
  • 深圳的网站建设公司 湖南岚鸿展馆设计费用取费标准
  • 做网站 广告收入iis更改默认网站
  • 东台网站建设服务商金融企业网站模板
  • 还有哪些行业可以做垂直网站合肥网站建设方案托管
  • 手机网站商城建设答辩问题做网站站长交加盟费
  • 网站内容协议如何创建自己公司的网站
  • 海口网站推广公司便利的响应式网站建设
  • 贴心的合肥网站建设做网站的封面图片哪里才有
  • 西安市做网站公司ue5培训机构哪家强
  • 合肥网站推广哪家好网站策划方法
  • 用jsp做网站的技术路线做的时间长的网站制作公司
  • 常州网站建设制作工作室深圳龙岗招聘网
  • 海南网站制做的公司网页下载链接怎么做
  • 06年可以做相册视频的网站电影网站开发开题报告
  • 宁夏吴忠网站建设中华建筑网官网
  • 广州达美网站建设网站开发 都包含什么语言
  • 找人做网站网站竞价推广账户竞价托管
  • qifeiye做的网站如何网站的设计 更新
  • 寻模板网站源码沈阳高端关键词优化
  • 杭州做网站哪家好网站建设域名是什么意思
  • 祥云网站建设网站建设 亿安网络
  • 免费空间申请网站做网站较好的公司
  • 普洱市住房和城乡建设局信息公开网站简单免费模板
  • 手机端网站优化太原建筑市场网站
  • 临沂网站建设吧广州网页制作
  • 国外个人网站模板签了外包合同被辞退有补偿吗
  • 在中国做外国网站怎么收钱php网站开发的成功经历
  • 网站管理平台模板网站建设最重要的是什么
  • 上海网站建设网站游戏petit模板wordpress