当前位置:网站首页>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
边栏推荐
- 品达通用权限系统(Day 5~Day 6)
- MSc 307 (88) (2010 FTPC code) Part 2 smoke and toxicity test
- From meeting a big guy to becoming a big guy, shengteng AI developer creation day brings infinite possibilities to developers
- Visualization of loss using tensorboard
- Backtracking maze problem
- Tiktok practice ~ pay attention to bloggers
- Zipkin service link tracking
- Market competitiveness of robot programming education
- 03 summary of various additions, updates and deletions of mongodb documents
- How to apply for ASTM E108 flame retardant test for photovoltaic panels?
猜你喜欢

JVM I: introduction to JVM and understanding of class files

Meichuang data security management platform has obtained the evaluation certificate of "data security product capability verification plan" of the Institute

Meichuang was selected into the list of "2022 CCIA top 50 Chinese network security competitiveness"

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

2022年中国音频市场年度综合分析

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

Multithreading and high concurrency III: AQS underlying source code analysis and implementation classes

How to learn a programming language systematically| Dark horse programmer

Tiktok practice ~ pay attention to bloggers

简单工厂模式
随机推荐
政策利好,20多省市开启元宇宙发展规划
From zero to one, I will teach you to build a "search by text and map" search service (I)
从零到一,教你搭建「以文搜图」搜索服务(一)
01 overview, application scenarios, Download methods, connection methods and development history of mongodb
【小程序实战系列】电商平台源码及功能实现
短视频平台开发,点击链接、图片自动跳转到新的页面
【Linux】【Mysql】ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘
A queue of two stacks
AS 3744.1标准中提及ISO8191测试,两者测试一样吗?
05 MongoDB对列的各种操作总结
03 MongoDB文档的各种增加、更新、删除操作总结
公司领导说,个人代码超10个Bug就开除,是什么体验?
【MySQL】多表连接查询
Simple factory mode
Une seule pile dans l'ordre inverse avec des fonctions récursives et des opérations de pile
内卷、躺平与中年危机的相关思考
RT-Thread 双向链表(学习笔记)
视频直播系统源码,倒计时显示,商品秒杀倒计时
MySQL master-slave replication, separation and resolution
After launching the MES system, these changes have taken place in the enterprise