jquery倒计时获取分钟和秒
你好 我可以从 此处 嵌入倒计时器
,但在“其他”选项卡中有 GetTime 部分。如上所述,“Periods”是一个数组,我们可以通过“Periods[5]”选择分钟和秒,通过“Periods[6]”选择分钟和秒(请参阅其文档 此处)。我使用相同的代码。我能够获取数据,但它的行为不像数组。这是我的代码:
var min=10;
var sec=30;
$('#eachQTimer').countdown({ until: '+' + min + 'm +' + sec + 's', format: 'YOWDHMS', significant: 2 });
var periods = $('#eachQTimer').countdown('getTimes');
alert(periods); // I tried :alert(periods[5]); / alert(periods[5].val());
它向我显示输出为:0,0,0,0,0,10,30。在警报框上。这很好。但为什么我无法获得 5 个索引值呢?不执行该行之后的后一行代码 如果我使用:alert(periods[5].value);然后变得未定义。
Hi
I am able to embed countdown timer from here
but as here in "Miscellaneous" tab there is GetTime section. where as said "Periods" is an array and we able to pick minutes and seconds by "Periods[5]" for minutes and "Periods[6]" form seconds (Please see its documentation here). I used same code . i am able to fetch the data but it is not behaving like array. this is my code:
var min=10;
var sec=30;
$('#eachQTimer').countdown({ until: '+' + min + 'm +' + sec + 's', format: 'YOWDHMS', significant: 2 });
var periods = $('#eachQTimer').countdown('getTimes');
alert(periods); // I tried :alert(periods[5]); / alert(periods[5].val());
it is showing me out put as : 0,0,0,0,0,10,30. on alert box. which is fine. but why am unable to get 5 indexed value then ? not executing latter single line of code after this line
and if i use : alert(periods[5].value); then getting undefined .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加点击功能。
Add a click function.