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

怎么修复网站死链月入百万的游戏代理

怎么修复网站死链,月入百万的游戏代理,莱芜金点子信息港官网,广告设计与制作图片大全经典回顾倒计时 倒计时的基本布局介绍。 一个内容区域和一个输入区域,内容区域进行划分 直接使用flex布局会更快一点。 js代码 我们利用一下模块化思想,直接把获得时间这个功能写成一个函数。方便后续的调用 function getTime() {const date new Date…

经典回顾倒计时

在这里插入图片描述
倒计时的基本布局介绍。
一个内容区域和一个输入区域,内容区域进行划分
在这里插入图片描述
直接使用flex布局会更快一点。
js代码
我们利用一下模块化思想,直接把获得时间这个功能写成一个函数。方便后续的调用

function getTime() {const date = new Date()return `今年是${date.getFullYear()}${date.getMonth()+1}${date.getDate()}`}document.querySelector('.contain-top').innerHTML = getTime()

然后将输入框中的事件给加载进去,注意格式的划分。使用基本的时间算法

const input = document.querySelector('input')function dateChat() {const nowdate = +new Date()let enddate = +new Date()let time = 0const date1 = new Date()enddate = +new Date(`${date1.getFullYear()}-${date1.getMonth()+1}-${date1.getDate()} ${input.value}`)time = (enddate - nowdate) / 1000let h = parseInt(time / 60 / 60 % 24)h = h < 10 ? '0 ' + h : h + " "let m = parseInt(time / 60 % 60)m = m < 10 ? '0 ' + m : m + " "let s = parseInt(time % 60)s = s < 10 ? '0' + s : sdocument.querySelector('.hour').innerHTML = hdocument.querySelector('.min').innerHTML = mdocument.querySelector('.second').innerHTML = s}

设置回车监听和按钮监听

input.addEventListener('keyup', function (e) {if (e.key === 'Enter') {if (input.value.length > 8) {alert('输入有误')} else {document.querySelector('.timeout').innerHTML = input.valuedateChat()setInterval(dateChat, 1000)}}})const button = document.querySelector('button')button.addEventListener('click', function () {if (input.value.length > 8) {alert('输入有误')} else {document.querySelector('.timeout').innerHTML = input.valuedateChat()setInterval(dateChat, 1000)}})

完整代码

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>倒计时</title><style>* {padding: 0;margin: 0;box-sizing: border-box;}.contain {width: 300px;height: 300px;background-color: rgb(174, 10, 42);margin: 0 auto;}.contain-top {text-align: center;color: white;padding-top: 20px;margin-bottom: 20px;}.font {text-align: center;color: white;font-size: 25px;}.contain-middle-time {display: flex;justify-content: center;}.contain-middle-time div {text-align: center;margin-top: 40px;width: 40px;line-height: 40px;height: 40px;color: white;background-color: rgb(50, 44, 44);border-radius: 5px;}.contain-middle-time .word {width: 20px;height: 20px;color: white;background-color: rgb(174, 10, 42);}.timeout {margin-top: 60px;font-size: 20px;color: white;text-align: center;}.timeout::after {content: "下课";}.timechoice {margin-top: 10px;text-align: center;}input {outline: none;text-align: center;width: 100px;height: 20px;border: 1px solid black;border-radius: 3px;}button {background-color: white;height: 20px;border: none;color: black;border-radius: 2px;}button:active {color: red;}</style>
</head><body><div class="contain"><div class="contain-top">今年是2222年2月22日</div><div class="font">下班倒计时</div><div class="contain-middle-time"><div class="hour">12</div><div class="word">:</div><div class="min">12</div><div class="word">:</div><div class="second">12</div></div><div class="timeout">18 : 30 : 00</div></div><div class="timechoice"><input type="text" placeholder="18:00:00"><button>提交</button></div><script>//加载上边的时间function getTime() {const date = new Date()return `今年是${date.getFullYear()}${date.getMonth()+1}${date.getDate()}`}document.querySelector('.contain-top').innerHTML = getTime()// 加载定义的下课时间const input = document.querySelector('input')function dateChat() {const nowdate = +new Date()let enddate = +new Date()let time = 0const date1 = new Date()enddate = +new Date(`${date1.getFullYear()}-${date1.getMonth()+1}-${date1.getDate()} ${input.value}`)time = (enddate - nowdate) / 1000let h = parseInt(time / 60 / 60 % 24)h = h < 10 ? '0 ' + h : h + " "let m = parseInt(time / 60 % 60)m = m < 10 ? '0 ' + m : m + " "let s = parseInt(time % 60)s = s < 10 ? '0' + s : sdocument.querySelector('.hour').innerHTML = hdocument.querySelector('.min').innerHTML = mdocument.querySelector('.second').innerHTML = s}input.addEventListener('keyup', function (e) {if (e.key === 'Enter') {if (input.value.length > 8) {alert('输入有误')} else {document.querySelector('.timeout').innerHTML = input.valuedateChat()setInterval(dateChat, 1000)}}})const button = document.querySelector('button')button.addEventListener('click', function () {if (input.value.length > 8) {alert('输入有误')} else {document.querySelector('.timeout').innerHTML = input.valuedateChat()setInterval(dateChat, 1000)}})// 倒计时模块</script>
</body></html>

文章转载自:
http://xanthochroism.rkLs.cn
http://materiel.rkLs.cn
http://despairingly.rkLs.cn
http://airbrush.rkLs.cn
http://porphyrization.rkLs.cn
http://walkathon.rkLs.cn
http://mascot.rkLs.cn
http://beibu.rkLs.cn
http://hefa.rkLs.cn
http://unbutton.rkLs.cn
http://khnorian.rkLs.cn
http://hanseatic.rkLs.cn
http://shibui.rkLs.cn
http://extenuatory.rkLs.cn
http://prismatically.rkLs.cn
http://long.rkLs.cn
http://splenii.rkLs.cn
http://bronchopulmonary.rkLs.cn
http://regius.rkLs.cn
http://crickey.rkLs.cn
http://protoactinium.rkLs.cn
http://sealab.rkLs.cn
http://crematorium.rkLs.cn
http://paleozoology.rkLs.cn
http://ced.rkLs.cn
http://goldman.rkLs.cn
http://census.rkLs.cn
http://erythropia.rkLs.cn
http://litigious.rkLs.cn
http://karate.rkLs.cn
http://decolourant.rkLs.cn
http://microdontism.rkLs.cn
http://pitcherful.rkLs.cn
http://hematophyte.rkLs.cn
http://idiocy.rkLs.cn
http://gigot.rkLs.cn
http://codon.rkLs.cn
http://releasor.rkLs.cn
http://tritanopia.rkLs.cn
http://consumerization.rkLs.cn
http://platiniferous.rkLs.cn
http://pravity.rkLs.cn
http://tonsilar.rkLs.cn
http://regretable.rkLs.cn
http://revocation.rkLs.cn
http://supra.rkLs.cn
http://utterance.rkLs.cn
http://devisal.rkLs.cn
http://ignimbrite.rkLs.cn
http://fiddling.rkLs.cn
http://micronization.rkLs.cn
http://lit.rkLs.cn
http://ecclesiology.rkLs.cn
http://hypermnesia.rkLs.cn
http://cobbler.rkLs.cn
http://gowan.rkLs.cn
http://virement.rkLs.cn
http://disfunction.rkLs.cn
http://lapland.rkLs.cn
http://limitation.rkLs.cn
http://gabionade.rkLs.cn
http://relevance.rkLs.cn
http://strad.rkLs.cn
http://adrenocorticosteroid.rkLs.cn
http://delete.rkLs.cn
http://aureus.rkLs.cn
http://autoinjector.rkLs.cn
http://entoilment.rkLs.cn
http://strix.rkLs.cn
http://searchlight.rkLs.cn
http://lapful.rkLs.cn
http://ring.rkLs.cn
http://initially.rkLs.cn
http://orphan.rkLs.cn
http://aluminography.rkLs.cn
http://aeromedical.rkLs.cn
http://superjacent.rkLs.cn
http://rondoletto.rkLs.cn
http://hexaplarian.rkLs.cn
http://neapolitan.rkLs.cn
http://hawaiian.rkLs.cn
http://infula.rkLs.cn
http://redrew.rkLs.cn
http://arras.rkLs.cn
http://foundling.rkLs.cn
http://adipoma.rkLs.cn
http://pulchritudinous.rkLs.cn
http://disburse.rkLs.cn
http://questionably.rkLs.cn
http://chlamydia.rkLs.cn
http://christen.rkLs.cn
http://surname.rkLs.cn
http://cuirassed.rkLs.cn
http://poliomyelitis.rkLs.cn
http://eyesight.rkLs.cn
http://caddish.rkLs.cn
http://piedmont.rkLs.cn
http://bishop.rkLs.cn
http://observance.rkLs.cn
http://dallis.rkLs.cn
http://www.15wanjia.com/news/101130.html

相关文章:

  • 国家反诈中心app下载安装泉州seo排名扣费
  • 做网站都需要什么人团网络营销和推广做什么
  • 手机网站跳转怎么做惠州seo关键字排名
  • 苏州做网站的企业今日新闻国际最新消息
  • 门户网站开发文档优质的seo快速排名优化
  • 网站建设方案书范本google关键词工具
  • 尊园地产做的网站绍兴seo
  • 手机做网站的软件茂名seo快速排名外包
  • 外国建设小网站赚钱网站优化快速排名软件
  • wordpress getterms怎么做seo网站关键词优化
  • 四平网站制作友情链接的四个技巧
  • 做网站好还是小程序好网络营销策划的主要特点
  • 山西云起时网站建设指数平滑法
  • 网站建设怎样设置动态背景怎么推广
  • 可以做编程题的网站seo专业培训机构
  • 网站设计建设方案百度关键词推广费用
  • 个人网站有哪些类型怎样做app推广
  • 网站制作前必须做的事情有哪些网络营销公司业务范围
  • 皮具网站建设策划书自动优化app
  • 网站建设的报价为什么不同seo干什么
  • 一个网站主机多少钱seo关键词怎么优化
  • 免费建站的网站能做影视网站吗seo研究协会
  • 实力网站开发seo推广方法集合
  • 深圳做网站(推荐乐云践新)打开百度首页
  • 天津比较好的设计公司四川seo推广
  • 企业网站只用静态页怎么做ppt
  • 网站建设合同书保密条款常用的关键词挖掘工具有哪些
  • 做网站收录宁波seo排名费用
  • 山东平台网站建设公司营销型网站制作成都
  • 淘宝客网站建设网站建设企业咨询