js控制图片切换

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片自动翻动播放 - www.codefans.net</title>
<style type="text/css">
<!--
.t14 {font-size: 9pt; line-height: 130%; text-decoration: none;}
.dg12 {font-size: 9pt; line-height: 14px; color: #0066cc; text-decoration: none}
.ttzy {font-size: 9pt; line-height: 16px; text-decoration: none; color: #A34F17}
a:hover {  text-decoration: underline}
a {  font-size: 12px}
.fdg12 {  font-weight:bold;font-size: 12px; line-height: 14px; color: #3D93BF; text-decoration: none}
.s { font-weight:bold; float:left; font-size:12px;padding:0 2px;border-right:1px solid #666; border-bottom:1px solid #666; margin:3px 0 0 5px;}
.s a{   text-decoration:none;  color:#bc2931; }
.s a:hover{ color:red;}
-->
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="headlineLayer" style="position:absolute; width:219px; height:0px; z-index:37; border: 1px none #000000;FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=1, motion='forward');">
  <table id='headline1' width='219' border='0' cellspacing='0' cellpadding='0' align='center' height='50'>
    <tr>
      <td>
        <table width="219" height="1" valign="middle" border="0" cellpadding="0" cellspacing="0" align="right">
          <tr>
            <td width="101" class="dg12"></td>
            <td width="52" class="dg12"></td>
            <td colspan="2" width="66" height="1">
              <!--
              <div align="center">
                <div class="s">1</div>
                <div class="s"><a href="javascript:jumpHeadline(2)">2</a></div>
                <div class="s"><a href="javascript:jumpHeadline(3)">3</a></div>
              </div>
-->
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td align="center">
        <table width="366" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><a href="http://www.codefans.net" target="_blank"><img src=http://www.codefans.net/jscss/demoimg/wall5.jpg width="329" height="228" vspace="6" border="0"><br>五一黄金周我们旅游再次出现高峰</a></td></tr></table>
      </td>
    </tr>
  </table>
</div>
<table id='headline1' border='0' cellspacing='0' cellpadding='0' height='50' style='display:none' width="219">
  <tr>
    <td>
      <table width="219" height="1" valign="middle" border="0" cellpadding="0" cellspacing="0" align="right">
        <tr>
          <td width="101" class="dg12"></td>
          <td width="52" class="dg12"></td>
          <td colspan="2" width="66" height="1">
            <!--
            <div align="center">
              <div class="s">1</div>
              <div class="s"><a href="javascript:jumpHeadline(2)">2</a></div>
              <div class="s"><a href="javascript:jumpHeadline(3)">3</a></div>
            </div>
-->
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="center"><a href="/" target='_blank' class='ttzy'></a>
      <table width="366" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top"><a href=/ target="_blank"><img src=http://www.codefans.net/jscss/demoimg/wall7.jpg width="329" height="228" vspace="6" border="0">
<br>人间仙镜,世外桃源</a></td></tr></table>
    </td>
  </tr>
</table>
<table id='headline2' width='219' border='0' cellspacing='0' cellpadding='0' height='50' style='display:none'>
  <tr>
    <td>
      <table width="219" height="1" valign="middle" border="0" cellpadding="0" cellspacing="0" align="right">
        <tr>
          <td width="101" class="dg12"></td>
          <td width="52" class="dg12"></td>
          <td colspan="2" width="66" height="1">
            <!--
            <div align="center">
              <div class="s"><a href="javascript:jumpHeadline(1)">1</a></div>
              <div class="s">2</div>
              <div class="s"><a href="javascript:jumpHeadline(3)">3</a></div>
            </div>
-->
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="center"><a href="/" target='_blank' class='ttzy'></a>
      <table width="366" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="top"><a href=/jscss/ target="_blank"><img src=http://www.codefans.net/jscss/demoimg/wall8.jpg  width="329" height="228" vspace="6" border="0"><br>黄金周成为摄影爱好者的天堂</a></td></tr></table>
    </td>
  </tr>
</table>
<table id='headline3' width='219' border='0' cellspacing='0' cellpadding='0' height='50' style='display:none'>
  <tr>
    <td>
      <table width="219" height="1" valign="middle" border="0" cellpadding="0" cellspacing="0" align="right">
        <tr>
          <td width="101" class="dg12"></td>
          <td width="52" class="dg12"></td>
          <td colspan="2" width="66" height="1">
            <!--
            <div align="center">
              <div class="s"><a href="javascript:jumpHeadline(1)">1</a></div>
              <div class="s"><a href="javascript:jumpHeadline(2)">2</a></div>
              <div class="s">3</div>
            </div>
-->
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="center"><a href=/ target='_blank' class='ttzy'></a>
      <table width="366" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="top"><a href=/ target="_blank"><img src=http://www.codefans.net/jscss/demoimg/wall9.jpg  width="329" height="228" vspace="6" border="0"><br>我们应冷静看待黄金周过后的社会危机</a></td>               </tr>             </table>
    </td>
  </tr>
</table>
<script language="javascript">
var currentIEBrowser = navigator.appName.indexOf("Microsoft") != -1;
var currentL=1;
var first=true;
function switchContent() {
 
    if(currentL >=4) currentL=1;
     if(first) currentL++;
    jumpHeadline(currentL++);
   
}
function jumpHeadline(c) {
    first=false;
 if(c < 1 || c >= 4) return;
 if(currentIEBrowser)
 {
  headlineLayer.filters[0].apply();
     headlineLayer.innerHTML = "<TABLE width='219' border='0' cellspacing='0' cellpadding='0' align='center'>"+document.getElementById('headline'+c).innerHTML+"</TABLE>";
  headlineLayer.filters[0].play();
 }else
 {
     document.getElementById('headlineLayer').innerHTML = "<TABLE width='219' border='0' cellspacing='0' cellpadding='0' align='center'>"+document.getElementById('headline'+c).innerHTML+"</TABLE>";
 }
 

setInterval("switchContent()",5000); 
</script>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值