js自动变化图象

< SCRIPT language = javascript >
var  ii = 1 ;
var  iii = 0 ;
var  no = 0 ;
var  speed = 2.5 ; // 设置图片翻动速度,现在为8秒钟翻一幅
var  imgobj;
var  tdobj;

function  testobj()
{
    
var  tbbb;
    tbbb
= document.all.tags( " table " ).item( 0 );
    
if  (tbbb == null )
    {
    
return   false ;
    }
    
else
    {
    
    imgobj
= tbbb.all.tags( " img " );
    tdobj
= tbbb.all.tags( " td " );
    
if  (imgobj.item( 0 ) == null || tdobj.item( 0 ) == null )
    {
    
return   false ;
    }
    
else
    {
    
return   true ;
    }
    }
}
function  isobj(obj)
{
    
if  (obj == null )
    {
    
return   false ;
    }
    
else
    {
    
return   true ;
    }
}
function  initimg()
{
    
var  imid, i;
    
var  imgnum = 0 ;
    
if  (isobj(imgobj.item( 0 )) && isobj(tdobj.item( 0 )))
    {
    imgnum
= imgobj.length;
    
for (i = 0 ;i < imgnum;i ++ )
    {
            tdobj.item(i).style.display
= " none " ;
            tdobj.item(i).style.textAlign
= " center " ;
            imgobj.item(i).style.filter
= " revealTrans(Duration=4.0, Transition=23) " ;
            imgobj.item(i).style.visibility
= " hidden " ;
    }
    }
    
return  imgnum;
}
function  changeimg()
{
    
var  nnn;
    
if  (testobj())
    {
        nnn
= initimg();
        showimg();
        setInterval(
" turnit( " + nnn + " ) " ,speed * 1000 );
    }
    
else
    {
        no
++ ;
        
if  (no < 3 ) setTimeout( " changeimg() " , 1000 );
    }
}
function  turnit(num)
{
    iii
= ii;
    
if  (ii < num - 1 )
    {
        ii
++ ;
    }
    
else
    {
        ii
= 0
    }
    hidimg();
    setTimeout(
" showimg() " , 1000 )
}
function  showimg()
{
    
var  ele,ele1;
    ele
= imgobj.item(ii);
    ele1
= tdobj.item(ii);
    ele2
= tdobj.item(iii);
    
if  (isobj(ele) && isobj(ele1) && isobj(ele2))
    {
    ele2.style.display
= " none " ;
    ele1.style.display
= "" ;
    ele.filters.item(
0 ).apply();
    ele.filters.item(
0 ).transition  =   12 ;
    ele.style.visibility 
=   "" ;
    ele.filters(
0 ).play( 1.0 );
    }
}
function  hidimg()
{
    
var  ele;
    ele
= imgobj.item(iii);
    
if  (isobj(ele))
    {
    ele.filters.item(
0 ).apply();
    ele.filters.item(
0 ).transition  =   12 ;
    ele.style.visibility 
= " hidden " ;
    ele.filters(
0 ).play( 1.0 );
    }
}
</ SCRIPT >

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="index_pic_files/style.css" type=text/css rel=stylesheet><STYLE type=text/css>.style4 {
 FONT-WEIGHT: bold; COLOR: #000000
}
BODY {
 MARGIN-TOP: 0px
}
</STYLE>

<META content="MSHTML 6.00.3790.2795" name=GENERATOR>
<link href="CSS.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY οnlοad=changeimg()>
<TABLE class=font cellSpacing=0 cellPadding=0 width=212 align=center border=0>
  <TBODY>
  <TR>
    <TD width=212 height=25 align="center" vAlign=bottom class="font_H"><IMG height=140 src="images/2006xinanducha.jpg"
      width=212 border=0><BR>
      动态新闻图片01</TD>
  </TR>
  <TR>
    <TD width=212 height=25 align="center" vAlign=bottom class="HT_ZT"><IMG height=140 src="images/220054193509.jpg"
      width=212 border=0><A class=font
      href="http://www.ycsafety.gov.cn/article.asp?art_id=331"
      target=_blank></A><BR>
      动态新闻图片02</TD>
  </TR>
  <TR>
    <TD width=212 height=25 align="center" vAlign=bottom class="HT_ZT"><IMG height=140 src="images/2006xinanducha.jpg"
      width=212 border=0><A class=font
      href="http://www.ycsafety.gov.cn/article.asp?art_id=321"
      target=_blank></A><BR>
      动态新闻图片03</TD>
  </TR>
  <TR>
    <TD width=212 height=25 align="center" vAlign=bottom class="HT_ZT"><IMG height=140 src="images/220054193509.jpg"
      width=212 border=0><A class=font href="http://www.ycsafety.gov.cn/article.asp?art_id=296" target=_blank></A><BR>
      动态新闻图片04</TD>
  </TR></TBODY></TABLE>
<SCRIPT language=javascript>
speed=5
</SCRIPT>
</BODY></HTML>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值