[查看演示] 源码如下 ---------------------------------------------------------- <style>body,td,div,a,input{font:menu}</style>
<script>
function timer() {
var scale=6;
d=new Date()
d.setDate(d.getDate()-1)
a=d.toLocaleString();
s=a.substr(17,2);
m=a.substr(14,2);
h=a.substr(11,2);
x=a.substr(18,1);
ss=new Date().getTime().toLocaleString();
sss=ss.substr(10,2);
document.all("is").height=s*scale;
document.all("im").height=m*scale;
document.all("ih").height=h*scale;
document.all("ii").height=sss*scale*0.6;
stxt.innerText=s;
mtxt.innerText=m;
htxt.innerText=h;
otxt.innerText=sss;
setTimeout("timer()",50);
}
window.onload=timer;
</script>
现在时间:
<div class=dtime style="position: absolute;width:600;top:500;left:100">
<div class=dtime title="秒" style="position: absolute;bottom:0;left:60" align="center"><img style="background-color: #00FF00" id="is" src="jsimg/px.gif" height="100" width="20" ><br><span id=stxt>:</span></div>
<div class=dtime title="分钟" style="position: absolute;bottom:0;left:30" align="center"><img style="background-color: green" id="im" src="jsimg/px.gif" height="100" width="20" ><br><span id=mtxt></span>:</div>
<div class=dtime title="小时" style="position: absolute;bottom:0;left:0" align="center"><img style="background-color: FF0000" id="ih" src="jsimg/px.gif" height="100" width="20" ><br><span id=htxt></span>:</div>
<div class=dtime title="00" style="position: absolute;bottom:0;left:90" align="center"><img style="background-color: yellow" id="ii" src="jsimg/px.gif" height="100" width="20" ><br><span id=otxt></span></div>
</div>
<body bgcolor="#000000" text="#00FF00">
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div> |