Authored by lijing

秒杀即将开始显示天数

... ... @@ -44,11 +44,16 @@ seckillObj = {
startTick: function(elem, offsetTime) {
var that = this,
$el = this.el,
hour = parseInt(offsetTime / (60 * 60), 10),
day = parseInt(offsetTime / (60 * 60 * 24), 10),
hour = parseInt(offsetTime % (60 * 60 * 24) / (60 * 60), 10),
minute = parseInt(offsetTime % (60 * 60) / 60, 10),
second = offsetTime % 60;
if (offsetTime) {
if (day <= 0) {
$('.day-c').addClass('hide');
}
$(elem).find('.tick.day').text(day < 0 ? '00' : (day < 10 ? ('0' + day) : day));
$(elem).find('.tick.hour').text(hour < 0 ? '00' : (hour < 10 ? ('0' + hour) : hour));
$(elem).find('.tick.minute').text(minute < 0 ? '00' : (minute < 10 ? ('0' + minute) : minute));
$(elem).find('.tick.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second));
... ... @@ -89,6 +94,7 @@ $(
'<div class="seckill-count">' +
'<div class="seckill-count-bg"></div>' +
'<div class="seckill-count-num">距秒杀开始:' +
'<span class="day-c"><i class="tick day">00</i>天</span>' +
'<i class="tick hour">00</i>时' +
'<i class="tick minute">00</i>分' +
'<i class="tick second">00</i>秒' +
... ... @@ -147,6 +153,7 @@ $(
'<div class="seckill-time seckill-time-border">' +
'<span>距结束&nbsp</span>' +
'<span class="end-time">' +
'<i class="tick day hide">00</i>:' +
'<i class="tick hour">00</i>:' +
'<i class="tick minute">00</i>:' +
'<i class="tick second">00</i>' +
... ... @@ -157,6 +164,7 @@ $(
'<div class="seckill-time seckill-time-border seckill-chose">' +
'<span>距结束 </span>' +
'<span class="end-time">' +
'<i class="tick day hide">00</i>:' +
'<i class="tick hour">00</i>:' +
'<i class="tick minute">00</i>:' +
'<i class="tick second">00</i>' +
... ...