请教各位,多谢
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%><html>
<head>
<meta name="generator" content="javascript editor 2">
<title>JavaScript Example</title>
<script language="javascript">
ImgData=new Array(4)
for(var i=0;i<ImgData.length;i++)
{
ImgData[i]=new Image(500,260)
ImgData[i].src="kobe_"+(i+7)+".gif"
}
function Separate(form)
{
var gifName=form.individual.options[form.individual.selectedIndex].value;
document.IMG1.src=gifName;
}
function Cache(form)
{
var gifIndex=form.cached.selectedIndex;
document.IMG2.src=ImgData[gifIndex].src;
}
function checkTimer()
{
if(document.Timer.timerBox.checked)
{
var newIndex=0;
var gifName=document.IMG2.src;
var gifIndex=(gifName.charAt(gifName.length-5))-1;
if(gifIndex<ImgData.length-1)
{
newIndex=gifIndex+1;
}
document.IMG2.src=ImgData[newIndex].src;
document.selections.cached.selectedIndex=newIndex;
var timeoutID=setTimeout("checkTimer()",3000)
}
}
</script>
</head>
<body onLoad=checkTimer()>
<center>
<h2>
Image Object Sample
</h2>
<table border="3">
<tr>
<th></th>
<th>
Individually Loaded
</th>
<th>
Pre-cached
</th>
</tr>
<tr>
<td align=right>
<b>Image:</b>
</td>
<td>
<img src="kobe_1.gif" name="IMG1" height=90 width=120>
</td>
<td>
<img src="kobe_2.gif" name="IMG2" height=90 width=120>
</td>
</tr>
<tr>
<td align=right>
<b>Select Image:</b>
</td>
<form name="selections">
<td>
<select name="individual" onChange="Separate(this.form)">
<option value="kobe_3.gif">
Wires
<option value="kobe_4.gif">
Keyboard
<option value="kobe_5.gif">
Disks
<option value="kobe_6.gif">
Cables
</select>
</td>
<td>
<select name="cached" onChange="Cache(this.form)">
<option value="kobe_7.gif">
Bands
<option Value="kobe_8.gif">
Clips
<option value="kobe_9.gif">
Lamp
<option value="kobe_10.gif">
Erasers
</select>
</td>
</form>
</tr>
</table>
<form name="Timer">
<input type="checkbox" name="timerBox" onClick="checkTimer()">
auto-cycle pre-cached images
</form>
</center>
</body>
</html>
这个程序是执行图片加载的
其中的function checkTimer()函数段实现的是什么东西啊?
请会的人告诉我,多谢了