Blogger Information
Blog 9
fans 0
comment 0
visits 6557
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
4.1 倒计时
师太的小迷弟的博客
Original
672 people have browsed it

实例

<!DOCTYPE html>
<html>
<head>
	<title>倒计时</title>
	<style type="text/css">
	*{margin: 0;padding: 0;}
		div{
			font-size: 36px;
			width: 1200px;
			height: 180px;
			margin: 100 auto;
			background: #82d741;
			line-height: 180px;
			text-align: center;
			color: #fff;
		}
	</style>
	<script type="text/javascript" src="http://ph7.shengqianku.cn/jquery-3.3.1.min.js"></script>
</head>
<body>
	<div>
		<p>2019年清明节倒计时:<span></span></p>
	</div>
	<script>
		$(function(){
			function Ro(){
				var d=Date.parse("Apr 05,2019")
				var date=new Date()
				var dd=date.getTime()
				var m=Math.floor((d-dd)/1000)//总
				var t=Math.floor(m/86400)//天
				var h=Math.floor(m%86400/3600)//小时
				var i=Math.floor(m%3600/60)//分钟
				var s=Math.floor(m%60)//秒
				$('span').text(t+"天"+h+"小时"+i+"分钟"+s+"秒")
			}
			setInterval(Ro,1000)
		})
	</script>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post