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

php 网站下载器北滘高明网站建设

php 网站下载器,北滘高明网站建设,深圳微商城网站制作,网站模板视频教程css计时器 animation实现计时器延时器 缺点当切页面导航会休眠不执行 最初需求是一个列表每个项目都有各自的失效时间 然后就想到 计时器延时器轮询等方案 这些方案每一个都要有自己的计时器 感觉不是很好 轮询也占资源 然后突发奇想 css能不能实现 开始想到的是transition测…css计时器 animation实现计时器延时器 缺点当切页面导航会休眠不执行 最初需求是一个列表每个项目都有各自的失效时间 然后就想到 计时器延时器轮询等方案 这些方案每一个都要有自己的计时器 感觉不是很好 轮询也占资源 然后突发奇想 css能不能实现 开始想到的是transition测试结果限制太大 然后就想到了动画 可以设置动画的执行时间 重复次数 延迟执行等 这些和计时器延时器类似 然后就去找js的监听事件 发现有监听动画的事件 经过测试 发现还可以 以下为测试的demo  动画的事件可以随意更改 如color width transform 看自己的需求 可以将 animation-delay放到style中 实现每个元素独立的延时器效果 vue框架 templatediv classbox!-- 使用v-bind动态添加样式 --div classmove :style{ animationDelay: 5s } animationendonDelayEndwebkitAnimationEndonDelayEnddiv classno/divdiv classoff/div/divdiv classboxdiv classmove2animationiterationonIntervalIterationwebkitAnimationIterationonIntervalIterationdiv classno/divdiv classoff/div/div/div/div /templatescript export default {data() {return {delayCount: 0,intervalCount: 0,};},methods: {onDelayEnd() {console.log(延时器 setTimeout);// 在此处可以添加延时器结束后的处理逻辑},onIntervalIteration() {this.intervalCount;console.log(计时器 setInterval this.intervalCount);// 在此处可以添加计时器每次迭代时的处理逻辑},}, }; /scriptstyle scoped .box {width: 50px;height: 50px;margin: 0 auto;border: 2px solid #ccc;overflow: hidden; }.move, .move2 {position: relative;width: 100px;height: 50px;display: flex;justify-content: flex-start; }.move {animation-name: move;animation-duration: 0;animation-fill-mode: forwards; }.move2 {animation-name: move2;animation-duration: 1s;animation-iteration-count: infinite; }.no, .off {width: 50%;height: 50px; }.no {background: gold; }.off {background: black; }keyframes move {from {left: 0;}to {left: -50px;} }keyframes move2 {from {left: 0;}to {left: -50px;} } /style 原生js !DOCTYPE html htmlheadmeta charsetutf-8title/titlestyle typetext/css.box {width: 50px;height: 50px;margin: 0 auto;border: 2px solid #ccc;overflow: hidden;}.move2,.move {position: relative;width: 100px;height: 50px;display: flex;justify-content: flex-start;}.move {animation-name: move;animation-duration: 0;animation-fill-mode: forwards;}.move2 {animation-name: move2;animation-duration: 1s;animation-iteration-count: infinite;}.off,.no {width: 50%;height: 50px;}.no {background: gold;}.off {background: black;}keyframes move {from {left: 0}to {left: -50px}}keyframes move2 {from {left: 0}to {left: -50px}}/style/headbodydiv classbox !-- styleanimation-delay: 5s 写到行内是因为可以动态添加 --div classmove styleanimation-delay: 5sdiv classno/divdiv classoff/div/div/divdiv classboxdiv classmove2div classno/divdiv classoff/div/div/div/bodyscript typetext/javascriptdocument.getElementsByClassName(move)[0].addEventListener(animationend, function() {console.log(延时器 setTimeout)});let count 0// let timer setInterval(() {// console.log(count)// }, 1000)document.getElementsByClassName(move2)[0].addEventListener(animationiteration, function() {console.log(计时器 setInterval count)// clearInterval(timer)// count 0// timer setInterval(() {// console.log(count)// }, 1000)});/script /html
http://www.hkea.cn/news/14313877/

相关文章:

  • 数字网站建设化妆品购物网站模板下载
  • 网站免费软件下载关于设计的网站
  • 西宁网站公司德州手机网站建设
  • 国内外网站开发技术中国字体设计网
  • 公关策划公司网站源码专门做民宿的网站有哪些
  • 网站建设案例教程全网整合营销外包
  • 做的电影网站很卡营销策划师资格证
  • 下载宝硬盘做网站集团定制网站建设公司
  • 怀集建设房管部门网站网上购物的网站有哪些
  • 有好点的网站建设公司吗番禺人才网官网单位招考
  • 网站推广推广网络培训平台有哪些
  • 网站改版建议策划书和网站合作有哪些活动可以做
  • 关于网站策划书描述准确的有百度网站联盟
  • 在网站开发中如何设置用户登录销售网站开发意义
  • 电子政务 和网站建设总结wordpress 上传apk
  • 江门市住房城乡建设局网站东莞智通人才网最新招聘信息
  • 苏州做企业网站有哪些相册制作软件
  • 仪征做网站公司网站开发项目计划书模板
  • 品牌网站建设 蝌蚪小7网站开发费用清单
  • 自做网站的步骤小程序快速搭建
  • wordpress 网站播放器插件网站seo 最好
  • html好看的网站的代码百度推广的方式
  • 域名被锁定网站打不开合肥房产网官网
  • 网站开发最新书籍桂林象鼻山离哪个高铁站近
  • 建站的费用网络热词
  • 集团网站群图虫网官网入口
  • 网站建设需要步骤随机关键词生成器
  • 做展示网站网站建设与管理学习什么
  • 北京经济技术开发区建设局网站定制衣服
  • 什么做电子书下载网站网站模板建设报价