【发布时间】:2023-03-15 01:10:01
【问题描述】:
我正在尝试使用 Keith Wood 提供的基本 .js 倒计时计时器,但在尝试调整布局时遇到了麻烦。因为我无法检查元素(每次检查它都会重新加载并消失,所以我无法确定需要调整哪些 CSS)。
我希望它输出为:XX 天 XX 小时 XX 分钟
我尝试在脚本中添加布局代码,但它什么也没做。
<script type="text/javascript">
$(function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
$('#defaultCountdown').countdown({until: austDay});
$('#year').text(austDay.getFullYear());
$('#textLayout').countdown({until: liftoffTime,
layout: '{sn} {sl}, {mn} {ml}, {hn} {hl}, and {dn} {dl}'});
});
</script>
这部分显然应该让它像我想要的那样输出,但它没有
$('#textLayout').countdown({until: liftoffTime,
layout: '{sn} {sl}, {mn} {ml}, {hn} {hl}, and {dn} {dl}'});
});
这里是现场:用户名是管理员密码是gogogo
【问题讨论】:
-
这是我自己设置的密码,我会在没有密码的情况下将其发布在这里,但这只需要努力删除密码。有什么意义?
-
你可以创建jsfiddle.net 样本吗?比在现场更容易查看
-
它在 JSFiddle 中有效,但在我的实时站点示例中无效。
-
Uncaught ReferenceError: liftoffTime is not defined在控制台中
标签: javascript jquery countdown countdowntimer jquery-countdown