主要代码:可以私信找我要png图片,奥力给!!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
function toDouble(n){
if(n<10){
return '0'+n;
}
else{
return ''+n;
}
}
window.onload=function()
{
var aImg=document.getElementsByTagName('img');
function tick(){
var oDate=new Date(); //时间对象
var str=toDouble(oDate.getHours())+toDouble(oDate.getMinutes())+toDouble(oDate.getSeconds());
for(var i=0;i<aImg.length;i++)
{
aImg[i].src='img/'+str[i]+'.png';
}
}
setInterval(tick,1000);
tick();
}
</script>
</head>
<body style="background:black; color:white; font-size:50px;">
<img src="img/0.png" />
<img src="img/0.png" />
:
<img src="img/0.png" />
<img src="img/0.png" />
:
<img src="img/0.png" />
<img src="img/0.png" />
</body>
</html>
效果图: