Blogger Information
Blog 18
fans 0
comment 0
visits 13464
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
jq实例倒计时-4.1
太早的博客
Original
588 people have browsed it

实例

<!DOCTYPE html>
<html>
<head>
	<title>hello world!</title>
	<style type="text/css">
	*{margin: 0;padding: 0;}
	div{font-size: 36px;width: 1200px;height: 180px;margin: 100px auto;background: #E43B1F;line-height: 180px;text-align: center;color: #fff}
	</style>
	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
	<div>
		<p>2020年春节倒计时:<span></span></p>
	</div>
	<script type="text/javascript">
		$(function(){
			function Ro(){
				var d=Date.parse("Jan 25,2020");
				var date=new Date();
				var dd=date.getTime();
				var rd=Math.floor((d-dd)/1000);
				var days=Math.floor(rd/86400);
				var hours=Math.floor(rd%86400/3600);
				var minus=Math.floor(rd%3600/60);
				var secos=Math.floor(rd%60);
				$("span").text(days+"天"+hours+"小时"+minus+"分钟"+secos+"秒")
			}
			setInterval(Ro,1)
		})
	</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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!