可供测试的全部代码:
<style type="text/css">
<!--
.myDIV {
FILTER: revealTrans(transition=18,duration=2);
WIDTH:650px;
POSITION: absolute;
left: -2px;
top: -170px;
height: 314;
}
-->
</style><table width="200" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top"> <div id="Layer3"><div >
<DIV id=sc1 class=myDIV onmouseover=isScroll(1) style='visibility: visible; width: 200px' onmouseout=isScroll(0)>
<table width='200' border='0' cellspacing='0' cellpadding='1' align="center">
<tr> <td align="center"><a href="cpzhanguang_medical.asp?meID=8" target='_blank'><img src=imges/divpic/gouqi.jpg border=0 width='200' height='294'></a></td>
</tr> </table> <table width='200' border='0' cellspacing='0' cellpadding='2' align='center'>
<tr> <td height='20' align='center' ><a href="cpzhanguang_medical.asp?meID=8" target='_blank' class='b12'>1111</a></td> </tr> <tr> <td height='3'></td> </tr> </table>
</div>
<DIV id=sc2 class=myDIV onmouseover=isScroll(1) style='VISIBILITY: hidden; width: 200px' onmouseout=isScroll(0)>
<table width='200' border='0' cellspacing='0' cellpadding='1' align="center"> <tr> <td align="center"><a href="cpzhanguang_medical.asp?meID=7" target='_blank'><img src=imges/divpic/sheini.jpg border=0 width='200' height='294'></a></td>
</tr> </table> <table width='200' border='0' cellspacing='0' cellpadding='2' align='center'> <tr> <td height='20' align='center'><a href="cpzhanguang_medical.asp?meID=7" target='_blank' class='b12'>2222</a></td> </tr> <tr> <td height='3'></td> </tr> </table>
</div>
</div></div>
</td>
</tr>
</table>
<SCRIPT>
var sc1=document.getElementById('sc1');
var sc2=document.getElementById('sc2');
var sc3=document.getElementById('sc3');
//设置显示哪个层的变量
var sL=1;
//设置动与不动的变量
var iS=0;
//设定显示时间
function setTime()
{
if(iS==0)
{
if(sL%2==1)
{
cs1(sc1,1);
cs1(sc2,0);
setTimeout('setTime()',5000);
}
else{
cs1(sc1,0);
cs1(sc2,1);
setTimeout('setTime()',5000);
}
sL++;
}
else
{
setTimeout('setTime()',5000);
}
}
//显示函数
function cs1(a,b)
{if(a==null)return;
a.filters.revealTrans.apply();
if(b==1) a.style.visibility='visible';
else a.style.visibility='hidden';
a.filters.revealTrans.play();}
//设定is变量
// v==1 不滚动 v==0 滚动
function isScroll(v){
iS=v;
}
</SCRIPT>
<style type="text/css">
<!--
.myDIV {
FILTER: revealTrans(transition=18,duration=2);
WIDTH:650px;
POSITION: absolute;
left: -2px;
top: -170px;
height: 314;
}
-->
</style><table width="200" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td valign="top"> <div id="Layer3"><div >
<DIV id=sc1 class=myDIV onmouseover=isScroll(1) style='visibility: visible; width: 200px' onmouseout=isScroll(0)>
<table width='200' border='0' cellspacing='0' cellpadding='1' align="center">
<tr> <td align="center"><a href="cpzhanguang_medical.asp?meID=8" target='_blank'><img src=imges/divpic/gouqi.jpg border=0 width='200' height='294'></a></td>
</tr> </table> <table width='200' border='0' cellspacing='0' cellpadding='2' align='center'>
<tr> <td height='20' align='center' ><a href="cpzhanguang_medical.asp?meID=8" target='_blank' class='b12'>1111</a></td> </tr> <tr> <td height='3'></td> </tr> </table>
</div>
<DIV id=sc2 class=myDIV onmouseover=isScroll(1) style='VISIBILITY: hidden; width: 200px' onmouseout=isScroll(0)>
<table width='200' border='0' cellspacing='0' cellpadding='1' align="center"> <tr> <td align="center"><a href="cpzhanguang_medical.asp?meID=7" target='_blank'><img src=imges/divpic/sheini.jpg border=0 width='200' height='294'></a></td>
</tr> </table> <table width='200' border='0' cellspacing='0' cellpadding='2' align='center'> <tr> <td height='20' align='center'><a href="cpzhanguang_medical.asp?meID=7" target='_blank' class='b12'>2222</a></td> </tr> <tr> <td height='3'></td> </tr> </table>
</div>
</div></div>
</td>
</tr>
</table>
<SCRIPT>
var sc1=document.getElementById('sc1');
var sc2=document.getElementById('sc2');
var sc3=document.getElementById('sc3');
//设置显示哪个层的变量
var sL=1;
//设置动与不动的变量
var iS=0;
//设定显示时间
function setTime()
{
if(iS==0)
{
if(sL%2==1)
{
cs1(sc1,1);
cs1(sc2,0);
setTimeout('setTime()',5000);
}
else{
cs1(sc1,0);
cs1(sc2,1);
setTimeout('setTime()',5000);
}
sL++;
}
else
{
setTimeout('setTime()',5000);
}
}
//显示函数
function cs1(a,b)
{if(a==null)return;
a.filters.revealTrans.apply();
if(b==1) a.style.visibility='visible';
else a.style.visibility='hidden';
a.filters.revealTrans.play();}
//设定is变量
// v==1 不滚动 v==0 滚动
function isScroll(v){
iS=v;
}
</SCRIPT>
var sL=0;
//设置动与不动的变量
var iS=0;//加载待控制的层
var sc = [];
sc.push(document.getElementById('sc1'));
sc.push(document.getElementById('sc2'));
sc.push(document.getElementById('sc3'));setTime();function setTime() {
if(iS == 0) {
for(var i=0; i<sc.length; i++) {
o = sc[i];
o.filters.revealTrans.apply();
if(i == sL) o.style.visibility='visible';
else o.style.visibility='hidden';
o.filters.revealTrans.play();
}
sL = (sL+1)%sc.length;
}
setTimeout('setTime()',5000);
}//设定is变量
// v==1 不滚动 v==0 滚动
function isScroll(v){
iS=v;
}