mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-28 13:21:37 +08:00
优化倒计时
This commit is contained in:
parent
4d2deaa203
commit
e529a96cf8
@ -1370,15 +1370,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.live-preview .tips {
|
.live-preview .tips {
|
||||||
font-size: 16px;
|
color: #999;
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.countdown .timer {
|
.countdown .timer .label {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.countdown .timer span {
|
.countdown .timer .value {
|
||||||
color: green;
|
color: green;
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -7,7 +7,7 @@ layui.use(['jquery', 'util'], function () {
|
|||||||
var serverTime = $('input[name="countdown.server_time"]').val();
|
var serverTime = $('input[name="countdown.server_time"]').val();
|
||||||
var liveStatusUrl = $('input[name="live.status_url"]').val();
|
var liveStatusUrl = $('input[name="live.status_url"]').val();
|
||||||
|
|
||||||
util.countdown(1000 * parseInt(endTime), 1000 * parseInt(serverTime), function (date, serverTime, timer) {
|
util.countdown(1000 * parseInt(endTime), 1000 * parseInt(serverTime), function (date) {
|
||||||
var items = [
|
var items = [
|
||||||
{date: date[0], label: '天'},
|
{date: date[0], label: '天'},
|
||||||
{date: date[1], label: '时'},
|
{date: date[1], label: '时'},
|
||||||
@ -16,7 +16,10 @@ layui.use(['jquery', 'util'], function () {
|
|||||||
];
|
];
|
||||||
var html = '';
|
var html = '';
|
||||||
layui.each(items, function (index, item) {
|
layui.each(items, function (index, item) {
|
||||||
html += '<span>' + item.date + '</span>' + item.label;
|
if (item.date > 0) {
|
||||||
|
html += '<span class="value">' + item.date + '</span>';
|
||||||
|
html += '<span class="label">' + item.label + '</span>';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('.countdown > .timer').html(html);
|
$('.countdown > .timer').html(html);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user