javascript/jquery时间倒计时 [英] javascript / jquery time count down

查看:58
本文介绍了javascript/jquery时间倒计时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用纯Javascript来制作一个函数,或者还希望从jquery中受益以倒计时到结束时间,例如:

I want to make a function either using pure Javascript or also benefiting from jquery to count down to an ending time such as:

//consumes a javascript date object
function countDown(endtimme){
...
}

,它应该以html之类的形式显示,例如

and it should display in html such as

<div id="time_left_box">
    <h1>Time remaining</h1>:

    <p>hours left: ..remaining day will be here## <p>
    <p>minutes left: ##remaining day will be here## <p>
    <p>seconds left: ##remaining day will be here## <p>
</div>

事实上,如果每秒刷新一次,那就更好了.

Indeed and it would be even more great if it can refresh itself every second.

我对javascript非常幼稚,对如何使用方法感到困惑,不胜感激.

I am very naive with javascript and confused about how to approach, any help would be appreciate.

推荐答案

您可以使用 jQuery Countdown

这篇关于javascript/jquery时间倒计时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆