jquery版的网页倒计时效果
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jquery版的网页倒计时效果</title>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>
<script type="text/javascript">
$(function () {
var time = 6000;//倒计时总秒数量
(function () {
var intDiff = parseInt(time);//倒计时总秒数量
function timer(intDiff) {
window.setInterval(function () {
var day = 0, hour = 0, minute = 0, second = 0;//时间默认值
if (intDiff > 0) {
day = Math.floor(intDiff / (60 * 60 * 24));
hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
}
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('#day_show').html(day);
$('#hour_show').html(hour);
$('#minute_show').html(minute);
$('#second_show').html(second);
intDiff--;
}, 1000);
}
$(function () {
timer(intDiff);
});
})(time)
})
</script>
</head>
<body>
<h1>网页上的倒计时</h1>
<div class="time-item">
<span id="day_show">0天</span>
<strong id="hour_show">0时</strong>
<strong id="minute_show">0分</strong>
<strong id="second_show">0秒</strong>
</div>
<!--倒计时模块-->
<!--<script src="http://www.jq22.com/js/jq.js"></script>-->
</body>
</html>
jquery版的网页倒计时效果的更多相关文章
- 【转载】jquery版的网页倒计时效果
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- jquery网页倒计时效果,秒杀,限时抢购!
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- jQuery CircleCounter的环形倒计时效果
在线演示1 本地下载 使用jQuery插件CircleCounter生成的环形倒计时效果,这个插件使用HTML5画布生成动画效果,还不错,大家可以试试! 顺带手录制了个代码,大家不吝赐教:http:/ ...
- jquery网页倒计时效果,秒杀
function FreshTime(){ var endtime=new Date('2019-4-12 18:00:00');//结束时间 var nowtime = new Date();//当 ...
- 【jquery插件】-网页下雪效果
又到了年底,从圣诞节开始,可以发现各大网站的活动是越来越多,都变的银装素裹,本人由于业务需求也需要做这么一个效果,所以就通过google大神找了一下相关资源,结果就出现了N种雪花效果的方式.种 ...
- 【jQuery】手机验证码倒计时效果
<ul class="ulist"> <li class="group"> <label class="label&qu ...
- javascript实现网页倒计时效果
一.HTML代码如下: <div class="timer" id="timer"> <span style="color: bla ...
- jquery页面多个倒计时效果
<div class="timeBox" data-times="2019/06/30,23:59:59"> 距结束 <span class= ...
- jQuery Countdown Timer 倒计时效果
这个一款简单的 jQuery 倒计时插件,用于显示剩余的天数,小时,分钟和秒.倒计时功能是非常有用的一个小功能,可以告诉用户多久以后您的网站将会发布或者关闭进行维护,还可以用于举办活动的开始和停止的倒 ...
随机推荐
- Hadoop 2.x 版本中的依赖 jar
- Angular 监听滚动条事件
一.引用fromEvent import { fromEvent } from 'rxjs'; 二.调用fromEvent this.subscribeScoll = fromEvent(window ...
- System.Web.Mvc.FilePathResult.cs
ylbtech-System.Web.Mvc.FilePathResult.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, Pub ...
- Android开发随笔
1.线性布局LinearLayout时,用到layout_weight权重的使用 控件的宽度(高度)=自身宽度(高度)+剩余空间的所占比例 剩余空间(可以为负值)=屏幕宽-所有控件宽度(高度)< ...
- CentOS 编译golang
CentOS 安装Mercurial http://hi.baidu.com/lang2858/item/cda8f6026cd522e0f45ba67f 获取代码 $ hg clone -u rel ...
- 如何应用AxureRP做原型设计
什么是原型呢?这个在之前介绍为什么需要进行原型设计当中有提到,原型是产品的最初形态,确认用户对产品界面和操作功能可用性的需求,高保真的原型接近于产品的最终形态,但仍只是原型.产品原型简单的说就是产品设 ...
- 第一周课堂笔记4th
1. if 对应着程序设计中的三种程序执行流程: 顺序结构,一条一条的按顺序执行,自上而下 选择结构,if else 单分支,双分支,多分支 循环结构 while for (后面学) 流程控制 ...
- VRRP概述-转
本文介绍了VRRP的基本原理.特点和应用. VRRP概述 随着Internet的发展,人们对网络的可靠性的要求越来越高.对于局域网用户来说,能够时刻与外部网络保持联系是非常重要的. 通常情况下,内部网 ...
- 服务器的tomcat调优和jvm调化
下面讲述的是tomcat的优化,及jvm的优化 Tomcat 的缺省配置是不能稳定长期运行的,也就是不适合生产环境,它会死机,让你不断重新启动,甚至在午夜时分唤醒你.对于操作系统优化来说,是尽可能的增 ...
- 2019-3-16-win10-uwp-鼠标移动到图片上切换图片
title author date CreateTime categories win10 uwp 鼠标移动到图片上切换图片 lindexi 2019-03-16 14:43:46 +0800 201 ...