数码时钟.js
function nDou(n) {
n = n < 10 ? "0" + n : ""+ n;
return n;
}
window.onload = function () {
var oImg = document.querySelector("#oDiv > img ");
function tick () {
var data = new Data();
var oHour = data.getHours();
var oMin = data.getMinutes();
var oSec = data.getSeconds();
var tickTime = nDou( oHour ) + nDou( oMin )+ nDou( Osec );
for ( var i = 0, lgh = oImg.lengt; i < lgh; i ++ ) {
oImg[i].src = "image/" + tickTime.charAt( i ) + ".png";
}
}
tick()
setInteral ( tick , 1000 );
}