js倒计时
来源:互联网 发布:重庆seo外包服务价格 编辑:程序博客网 时间:2024/06/05 10:45
<script type=
"text/javascript"
src=
"js/jquery.min.js"
></script>
<script type=
"text/javascript"
>
var
intDiff = parseInt(60);
//倒计时总秒数量
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(
'<s id="h"></s>'
+hour+
'时'
);
$(
'#minute_show'
).html(
'<s></s>'
+minute+
'分'
);
$(
'#second_show'
).html(
'<s></s>'
+second+
'秒'
);
intDiff--;
}, 1000);
}
$(
function
(){
timer(intDiff);
});
</script>
阅读全文
0 0
- js 倒计时
- 倒计时js
- 倒计时js
- JS倒计时
- js 倒计时
- js 倒计时
- js倒计时
- js 倒计时
- JS倒计时
- js 倒计时
- js倒计时。
- js倒计时
- js倒计时
- JS倒计时
- JS倒计时
- js倒计时
- js 倒计时
- js倒计时
- 数组
- RestTemplate 遇到泛型参数时,用exchange方法
- 散列函数工具类
- MyBatis-Spring(一)
- Elasticsearch与Solr 选型
- js倒计时
- 二项堆 Binomial Heap
- Thymeleaf教程 (四) Thymeleaf标准表达式语法(上)
- 使用AspectJ提供的注解方式实现aop
- 【模板】树状数组求逆序对
- 知识点(总结)
- SeekBar(拖动条)-SeekBar基本用法
- 不求甚解-Shiro
- 解决Invalid character found in the request target. The valid characters are defined in RFC 7230 and RF