当前位置:网站首页>Source code of live video system, countdown display, countdown of commodity spike
Source code of live video system, countdown display, countdown of commodity spike
2022-06-28 04:17:00 【Yunbao network technology】
Live video system source code , The countdown shows , Second kill countdown of commodities
style :
<style>
body {
background-color: gray;
}
ul {
list-style: none;
}
ul li {
border: 1px solid black;
float: left;
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
border-radius: 5px;
margin-right: 10px;
}
ul li:nth-child(1) {
width: 150px;
}
ul li:nth-child(5) {
margin: 0;
}
</style>
structure :
<ul>
<li> Countdown to lottery time </li>
<li id="d"></li>
<li id="h"></li>
<li id="c"></li>
<li id="s"></li>
</ul>
Behavior :
```javascript
<script>
// Initialize time variable
var d = 0,
h = 0,
c = 0,
s = 0;
// Set the end time
var endTime = new Date('2021-11-24 19:49:50').getTime();
// Set the timer dingshiqi =》 Timer
var dingshiqi = setInterval(action, 1000);
function action() {
// Get the current time
var now_time = new Date().getTime();
// The time remaining until the end End time - present time
var lase_time = (endTime - now_time) / 1000;
// Determine whether to end the countdown
if (lase_time > 0) {
// Calculate remaining days
d = parseInt(lase_time / (60 * 60 * 24));
// Calculate the remaining hours
h = parseInt((lase_time / (60 * 60)) % 24);
// Calculate minutes remaining :
c = parseInt((lase_time / 60) % 60);
// Calculate the current seconds
s = parseInt(lase_time % 60);
// Format the output :( Less than 10 The situation of , Add in front 0)
d = d < 10 ? '0' + d : d;
h = h < 10 ? '0' + h : h;
c = c < 10 ? '0' + c : c;
s = s < 10 ? '0' + s : s;
} else {
clearInterval(dingshiqi);
d = h = c = s = '00';
}
// Transfer data to html in
document.getElementById('d').innerHTML = d + ' God ';
document.getElementById('h').innerHTML = h + ' when ';
document.getElementById('c').innerHTML = c + ' branch ';
document.getElementById('s').innerHTML = s + ' second ';
}
</script>
That's all Live video system source code , The countdown shows , Second kill countdown of commodities , More content welcome to follow the article
边栏推荐
猜你喜欢

政策利好,20多省市开启元宇宙发展规划

Introduction to SQLSERVER database

机器学习入门笔记

La norme européenne en 597 - 1 pour les meubles est - elle la même que les deux normes en 597 - 2 pour les ignifuges?

《性能之巅第2版》阅读笔记(二)--CPU监测

Reading notes of top performance version 2 (II) -- CPU monitoring

软件测试报告怎么编写?第三方性能报告范文模板来了

2022年6月对自己近况的一次总结

Introduction to multi project development, basic design class library project use

From meeting a big guy to becoming a big guy, shengteng AI developer creation day brings infinite possibilities to developers
随机推荐
Web APIs DOM event foundation dark horse programmer
Chapter 1 Introduction to bash
leetcode:714. 买卖股票的最佳时机含手续费【dp双状态】
PostgreSQL 实现批量更新、删除、插入
Uncover the mystery of SSL and learn how to protect data with SSL
Two methods of shell script parameter passing based on arm5718
Reading notes of top performance version 2 (II) -- Performance observation tool
Secouer le son et se battre ~ prêter attention au blogueur
leetcode - 329. Longest increasing path in matrix
MSC 307(88) (2010 FTPC Code) Part 9床上用品试验
等保三级密码复杂度是多少?多久更换一次?
Principle of event delegation
GenICam GenTL 标准 ver1.5(2)
Visualization of loss using tensorboard
11_ Deliberate practice and elaboration
TFTLCD display experiment of mini plate based on punctual atom stm32
RT-Thread 双向链表(学习笔记)
领歌leangoo敏捷看板工具新增导出卡片文档和粘贴共享脑图节点功能
Analysis of future teacher research ability under steam education framework
2021年终总结及2022年展望