当前位置:网站首页>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
边栏推荐
- MSC 307(88) (2010 FTPC Code) Part 9床上用品试验
- English grammar_ Adjective / adverb Level 3 - Comparative
- Reading notes of top performance version 2 (II) -- CPU monitoring
- Resolve cross domain
- PostgreSQL implements batch update, deletion and insertion
- 05 MongoDB对列的各种操作总结
- Analyzing the comprehensive application ability of educational robot
- 04 MongoDB各种查询操作 以及聚合操作总结
- GO语言-select语句
- 成长一夏 挑战赛来袭 | 学习、创作两大赛道,开启导师报名啦!
猜你喜欢

How to write a software test report? Here comes the third party performance report template

光伏板怎么申请ASTM E108阻燃测试?

简单工厂模式

leetcode - 329. Longest increasing path in matrix

In the era of video explosion, who is supporting the high-speed operation of video ecological network?

抖音实战~关注博主

RT thread bidirectional linked list (learning notes)

设计一个有getMin功能的栈

使用tensorboard进行loss可视化

Little knowledge about function templates --
随机推荐
Conversion between decimal and BCD codes in C language
Lamaba expression learning and common functional interfaces
Introduction notes to machine learning
等保三级密码复杂度是多少?多久更换一次?
What is the process of en 1101 flammability test for curtains?
仅用递归函数和栈操作逆序一个栈
Staggered and permutation combination formula
Using elk to build a log analysis system (I) -- component introduction
How to write a software test report? Here comes the third party performance report template
02 mongodb data types, important concepts and common shell instructions
Open the field of maker education and creation
2021 year end summary and 2022 outlook
10:00面试,10:02就出来了 ,问的实在是太...
Multithreading and high concurrency six: source code analysis of thread pool
From zero to one, I will teach you to build a "search by text and map" search service (I)
Another option for ERP upgrade, MES system
机器学习入门笔记
Elk builds log analysis system + Zipkin service link tracking integration
[small program practice series] e-commerce platform source code and function implementation
leetcode - 329. 矩阵中的最长递增路径