话不多说,请看代码:
<Meta charset="UTF-8">
倒计时-多种格式调用-原生js封装
css-3*/
white-space: -moz-pre-wrap; /*Mozilla,since1999*/
white-space: -pre-wrap; /*Opera4-6*/
white-space: -o-pre-wrap; /*Opera7*/
word-wrap: break-word; /*InternetExplorer5.5+*/
}
.example{
padding-top:40px;
margin-bottom:90px;
}
.example .call{
padding:18px 5px;
background:#f0f5f8;
}
.example h2{
padding-top:20px;
margin-bottom:7px;
}
.example table {
width:100%;
table-layout:fixed;
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #cee1ee;
border-left: 0;
}
.example thead {
border-bottom: 1px solid #cee1ee;
background-color: #e3eef8;
}
.example tr {
line-height: 24px;
font-size: 13px;
}
.example tr:nth-child(2n) {
background-color: #f0f5f8;
}
.example tr th,.example tr td {
border-left: 1px solid #cee1ee;
word-break: break-all;
word-wrap: break-word;
padding:0 10px;
font-weight: normal;
}
.example tr th {
color: #555;
padding-top: 2px;
padding-bottom: 2px;
text-align: left;
}
/*公共*/
.countdown {
margin-bottom: 15px;
}
#例子1# 12:00:00到11:50:00
countEnd: 'function',设置结束倒计时后触发的函数/默认值为空,执行其他默认参数
new countdown("#countdown1",countEnd: function() { alert("结束") } });
#例子3# 60到0
format:'yy:MM:dd:hh:mm:ss',格式化输出的时间格式/默认值为'hh:mm:ss',执行其他默认参数
new countdown("#countdown3",{ format:'yy:MM:dd:hh:mm:ss' });
options参数
说明 | |
---|---|