<body>
<div id="timer">
<img src="0.gif" name="h0" width="15" height="28">
<img src="0.gif" name="h1" width="15" height="28">
<img src="x.gif" width="15" height="28">
<img src="0.gif" name="m0" width="15" height="28">
<img src="0.gif" name="m1" width="15" height="28">
<img src="x.gif" width="15" height="28">
<img src="0.gif" name="s0" width="15" height="28">
<img src="0.gif" name="s1" width="15" height="28">
</div>
<script language="javascript">
var t_h,t_m,t_s;
image0="0.gif";
image1="1.gif";
image2="2.gif";
image3="3.gif";
image4="4.gif";
image5="5.gif";
image6="6.gif";
image7="7.gif";
image8="8.gif";
image9="0.gif";
change_time();
function change_time(){
var v0,v1;
time=new Date();
t_h=time.getHours();
t_m=time.getMinutes();
t_s=time.getSeconds();
vo=parseInt(t_h/10);
v1=t_h%10;
document.images['h0'].src=eval("image"+vo);
document.images['h1'].src=eval("image"+v1);
v0=parseInt(t_m/10);
v1=t_m%10;
document.images['m0'].src=eval("image"+vo);
document.images['m1'].src=eval("image"+v1);
v0=parseInt(t_s/10);
v1=t_s%10;
document.images['s0'].src=eval("image"+vo);
document.images['s1'].src=eval("image"+v1);
setTimeout("change_time()",100);
}
</script>
</body>
</html>
<div id="timer">
<img src="0.gif" name="h0" width="15" height="28">
<img src="0.gif" name="h1" width="15" height="28">
<img src="x.gif" width="15" height="28">
<img src="0.gif" name="m0" width="15" height="28">
<img src="0.gif" name="m1" width="15" height="28">
<img src="x.gif" width="15" height="28">
<img src="0.gif" name="s0" width="15" height="28">
<img src="0.gif" name="s1" width="15" height="28">
</div>
<script language="javascript">
var t_h,t_m,t_s;
image0="0.gif";
image1="1.gif";
image2="2.gif";
image3="3.gif";
image4="4.gif";
image5="5.gif";
image6="6.gif";
image7="7.gif";
image8="8.gif";
image9="0.gif";
change_time();
function change_time(){
var v0,v1;
time=new Date();
t_h=time.getHours();
t_m=time.getMinutes();
t_s=time.getSeconds();
vo=parseInt(t_h/10);
v1=t_h%10;
document.images['h0'].src=eval("image"+vo);
document.images['h1'].src=eval("image"+v1);
v0=parseInt(t_m/10);
v1=t_m%10;
document.images['m0'].src=eval("image"+vo);
document.images['m1'].src=eval("image"+v1);
v0=parseInt(t_s/10);
v1=t_s%10;
document.images['s0'].src=eval("image"+vo);
document.images['s1'].src=eval("image"+v1);
setTimeout("change_time()",100);
}
</script>
</body>
</html>
解决方案 »
- 求帮修改代码,如何实现点击小图片出现大图片后,出现几个连接按扭
- js怎么传递当前对象
- [玻璃鱼V]有关在网页中插入FLASH的问题
- table对于访问会有限制,怎么会拒绝访问呢?
- 关于javascript 的问题
- javascript如何实实现将信息中的一数字替换成特定文字
- ***********轮换广告加文字可以实现吗(在线等待)
- 怎么判断一个文本框是否存在
- 我画的表格,为什么列的宽度会随着列内容的长短而自动变化?没有分了,帮帮忙
- javascript如何实现网页下载的进度条功能?
- 怎么在页面打开时将全屏的窗口调为正常状态?
- 高手来解答:在CSS中如何区分<input type=text>和<input type=button>,搞定加100分
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时间</title>
</head>
<body>
<div id="timer">
<img src="0.jpg" name="h0" width="15" height="28">
<img src="0.jpg" name="h1" width="15" height="28">
<img src="x.jpg" width="15" height="28">
<img src="0.jpg" name="m0" width="15" height="28">
<img src="0.jpg" name="m1" width="15" height="28">
<img src="x.jpg" width="15" height="28">
<img src="0.jpg" name="s0" width="15" height="28">
<img src="0.jpg" name="s1" width="15" height="28">
</div>
<script language="javascript">
var t_h,t_m,t_s;
image0=new Image();image0.src="010.gif";
image1=new Image();image1.src="001.gif";
image2=new Image();image2.src="002.gif";
image3=new Image();image3.src="003.gif";
image4=new Image();image4.src="004.gif";
image5=new Image();image5.src="005.gif";
image6=new Image();image6.src="006.gif";
image7=new Image();image7.src="007.gif";
image8=new Image();image8.src="008.gif";
image9=new Image();image9.src="011.gif";
change_time();
function change_time(){
var v0,v1;
time=new Date();
t_h=time.getHours();
t_m=time.getMinutes();
t_s=time.getSeconds();
v0=parseInt(t_h/10);
v1=t_h%10;
document.images['h0'].src=eval("image"+v0+".src");
document.images['h1'].src=eval("image"+v1+".src");
v0=parseInt(t_m/10);
v1=t_m%10;
document.images['m0'].src=eval("image"+v0+".src");
document.images['m1'].src=eval("image"+v1+".src");
v0=parseInt(t_s/10);
v1=t_s%10;
document.images['s0'].src=eval("image"+v0+".src");
document.images['s1'].src=eval("image"+v1+".src");
setTimeout("change_time()",100);
}
</script>
</body>
</html>
image对象是src属性来指定图片
<script language="javascript">
var t_h,t_m,t_s;
image0=new Image();image0.src="0.gif";
image1=new Image();image1.src="1.gif";
image2=new Image();image2.src="2.gif";
image3=new Image();image3.src="3.gif";
image4=new Image();image4.src="4.gif";
image5=new Image();image5.src="5.gif";
image6=new Image();image6.src="6.gif";
image7=new Image();image7.src="7.gif";
image8=new Image();image8.src="8.gif";
image9=new Image();image9.src="0.gif";
change_time();
function change_time(){
var v0,v1;
time=new Date();
t_h=time.getHours();
t_m=time.getMinutes();
t_s=time.getSeconds();
vo=parseInt(t_h/10);
v1=t_h%10;
document.images['h0'].src=eval("image"+vo+".src");
document.images['h1'].src=eval("image"+v1+".src");
v0=parseInt(t_m/10);
v1=t_m%10;
document.images['m0'].src=eval("image"+vo+".src");
document.images['m1'].src=eval("image"+v1+".src");
v0=parseInt(t_s/10);
v1=t_s%10;
document.images['s0'].src=eval("image"+vo+".src");
document.images['s1'].src=eval("image"+v1+".src");
setTimeout("change_time()",100);
}
</script>
wangxj0600(闭门思过中) 比我快了一点