如何更改keith wood jQuery倒计时中的时钟文本
How to change the clock text in keith-wood jQuery Countdown
我正在使用keith wood Jquery倒计时。我的示例代码如下
<link rel="stylesheet" type="text/css" href="http://keith-wood.name/css/jquery.countdown.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://keith-wood.name/js/jquery.plugin.js"></script>
<script type="text/javascript" src="http://keith-wood.name/js/jquery.countdown.js"></script>
<script>
$(function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
$('.countdown1').countdown({until: austDay});
$('.countdown2').countdown({until: austDay, format: 'HMS'});
});
</script>
Countdown1:
<div class="countdown1"></div><br/><br/><br/>
Countdown2:
<div class="countdown2"></div>
我只想更改第二个div的时钟文本。例如,我想将Hours替换为Hr,Minutes替换为Min,Seconds替换为Sec,仅用于倒计时2。
你需要这个吗:
在初始化countdown
:时,按照以下要求设置labels:
labels: ['Years', 'Months', 'Weeks', 'Days', 'Hrs', 'Min', 'Sec']
$(function () {
var austDay = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
$('.countdown1').countdown({until: austDay});
$('.countdown2').countdown({labels: ['Years', 'Months', 'Weeks', 'Days', 'Hrs', 'Min', 'Sec'], until: austDay, format: 'HMS'});
});
<link rel="stylesheet" type="text/css" href="http://keith-wood.name/css/jquery.countdown.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://keith-wood.name/js/jquery.plugin.js"></script>
<script type="text/javascript" src="http://keith-wood.name/js/jquery.countdown.js"></script>
Countdown1:
<div class="countdown1"></div><br/><br/><br/>
Countdown2:
<div class="countdown2"></div>
相关文章:
- 如何使用jquery在填充自动完成的值后使文本框只读
- 使用Clipboard.js复制span文本
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 用程序搜索JQuery数据表中的文本
- jQuery匹配JSON对象的部分文本
- onkeyup无法动态创建多个文本区域
- 如何在下面的ES6循环中获得前面的文本
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 让文本输入幻灯片显示输入时的新文本输入?然后向后滑动
- 借助asp.net验证或java脚本对多个文本进行验证
- 无法在ajaxStart中更改跨度文本
- 高亮显示时编辑文本大小和颜色
- jquery中的文本框验证
- Javascript,有没有一种方法可以将数组写成没有逗号或空格的单个文本字符串
- Sails.js:同时发布文本输入和一个文件
- 当鼠标悬停在文本中的单词上时显示警报
- 是否有任何方法可以使用jQuery替换在数组中定义值的文本
- 将纯文本URL转换为可单击链接
- 如何使用nodes和.createElement(“b”)将文本加粗
- 如何更改keith wood jQuery倒计时中的时钟文本