日期:2014-05-16  浏览次数:20335 次

请问这个代码错在那里了?
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN ">
<!--   saved   from   url=(0026)http://127.0.0.1/photo.asp   -->
<HTML> <HEAD>
<META   http-equiv=Content-Type   content= "text/html;   charset=gb2312 ">
<SCRIPT   language=JavaScript1.2>
var   time1   =   0;   //打开页面时等待图片载入的时间,单位为秒,可以设置为0
var   time2   =   5;   //图片轮转的间隔时间

var   timeout1   =   time1*1000;
var   timeout2   =   time2*1000;
var   nn;
nn=1;//初始焦点
var   curFileNum   =   1;//传递给myPlayer对象   表示目前焦点序列值
if(navigator.appName   ==   "Microsoft   Internet   Explorer "){
setTimeout( 'change_img() ',timeout1);
}
function   change_img(){
if(nn> 5)   nn=1
setTimeout( 'setFocus2( '+nn+ ') ',timeout1);
nn++;
tt=setTimeout( 'change_img() ',timeout2);
}
function   setFocus2(i){
curFileNum   =   i;
selectLayer1(i);
}
function   setFocus1(i){
nn   =   i;
curFileNum   =   i;
selectLayer1(i);
}
function   selectLayer1(i){
switch(i){
case   1:
document.getElementById( "focusPic1 ").style.display= "block ";
document.getElementById( "focusPic2 ").style.display= "none ";
document.getElementById( "focusPic3 ").style.display= "none ";
document.getElementById( "focusPic4 ").style.display= "none ";
document.getElementById( "focusPic5 ").style.display= "none ";
break;
case   2:
document.getElementById( "focusPic1 ").style.display= "none ";
document.getElementById( "focusPic2 ").style.display= "block ";
document.getElementById( "focusPic3 ").style.display= "none ";
document.getElementById( "focusPic4 ").style.display= "none ";
document.getElementById( "focusPic5 ").style.display= "none ";
break;
case   3:
document.getElementById( "focusPic1 ").style.display= "none ";
document.getElementById( "focusPic2 ").style.display= "none ";
document.getElementById( "focusPic3 ").style.display= "block ";
document.getElementById( "focusPic4 ").style.display= "none ";
document.getElementById( "focusPic5 ").style.display= "none ";
break;
case   4:
document.getElementById( "focusPic1 ").style.display= "none ";
document.getElementById( "focusPic2 ").style.display= "none ";
document.getElementById( "focusPic3 ").style.display= "none ";
document.getElementById( "focusPic4 ").style.display= "block ";
document.getElementById( "focusPic5 ").style.display= "none ";
break;
case   5:
document.getElementById( "focusPic1 ").style.display= "none ";
document.getElementById( "focusPic2 ").style.display= "none ";
document.getElementById( "focusPic3 ").style.display= "none ";
document.getElementById( "focusPic4 ").style.display= "none ";
document.getElementById( "focusPic5 "