<script type="text/javascript" language="javascript">
function daojishi() {
window.setTimeout("daojishi() ", 1000);
PaiDay = new Date("07-05-2010 20:00:00"); //计时日期
today = new Date();
timeold = (PaiDay.getTime() - today.getTime());
sectimeold = timeold / 1000
secondsold = Math.floor(sectimeold);
msPerDay = 24 * 60 * 60 * 1000
e_daysold = timeold / msPerDay
daysold = Math.floor(e_daysold);
e_hrsold = (e_daysold - daysold) * 24;
hrsold = Math.floor(e_hrsold);
e_minsold = (e_hrsold - hrsold) * 60;
minsold = Math.floor((e_hrsold - hrsold) * 60);
seconds = Math.floor((e_minsold - minsold) * 60);
document.getElementById("day").innerHTML = daysold;
document.getElementById("hour").innerHTML = hrsold;
document.getElementById("min").innerHTML = minsold;
document.getElementById("sec").innerHTML = seconds;
}
daojishi();
</script>
倒计时的JS
最新推荐文章于 2024-09-02 17:27:54 发布