<div class="timer">
<span id="years">00</span>:
<span id="months">00</span>:
<span id="days">00</span>:
<span id="hours">00</span>:
<span id="minutes">00</span>:
<span id="seconds">00</span>
</div>
<script type="text/javascript">
// 获取本机当前时间
var mydate = new Date();
// console.log(mydate.getFullYear(), parseInt(mydate.getMonth())+1, mydate.getDate(), mydate.getHours(), mydate.getMinutes(), mydate.getSeconds());
var futureDate = eval(Date.UTC(2014, 10, 30, 12, 0, 0));
// var nowDate = eval(Date.UTC(2013, 11, 15, 16, 36, 52));
var nowDate = eval(Date.UTC(mydate.getFullYear(), parseInt(mydate.getMonth())+1, mydate.getDate(), mydate.getHours(), mydate.getMinutes(), mydate.getSeconds()));
var obj = {
sec: document.getElementById("seconds"),
mini: document.getElementById("minutes"),
hour: document.getElementById("hours"),
day: document.getElementById("days"),
day: document.getElementById("months"),
day: document.getElementById("years")
}
fnTimeCountDown(futureDate, obj, nowDate, function () {
// console.log('时间到了!');
});
</script>
|