图片批量滚动

<!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>图片批量滚动</title>
</head>
<body>
<div id=box0 style='overflow:hidden;height:120px;width:700px;color:#ff0000'>
  <table align=left cellpadding=0 cellspace=0 border=0>
    <tr>
      <td id=pic01 valign=top><table border=0 cellpadding=0 cellspacing=0>
          <tr>
            <td><a href=http://www.fankelipinka.com target=_blank><img border=0 src="1.jpg" width=150 height=100 hspace=22></a><br>
              <center>
                <b>说明一</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.wangtx.com target=_blank><img border=0 src="2.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明二</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.yamaxun.org target=_blank><img border=0 src="3.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明三</b>
              </center></td>
            <td><a href=http://www.cnwenger.com target=_blank><img border=0 src="4.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明四</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.pc555.com target=_blank><img border=0 src="5.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明五</b>
              </center></td>
          </tr>
        </table></td>
      <td id=pic02 valign=top></td>
    </tr>
  </table>
</div>

<div id=box1 style='overflow:hidden;height:120px;width:700px;color:#ff0000'>
  <table align=left cellpadding=0 cellspace=0 border=0>
    <tr>
      <td id=pic11 valign=top><table border=0 cellpadding=0 cellspacing=0>
          <tr>
            <td><a href=http://www.fankelipinka.com target=_blank><img border=0 src="5.jpg" width=150 height=100 hspace=22></a><br>
              <center>
                <b>说明一</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.wangtx.com target=_blank><img border=0 src="4.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明二</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.yamaxun.org target=_blank><img border=0 src="3.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明三</b>
              </center></td>
            <td><a href=http://www.cnwenger.com target=_blank><img border=0 src="2.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明四</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.pc555.com target=_blank><img border=0 src="1.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明五</b>
              </center></td>
          </tr>
        </table></td>
      <td id=pic12 valign=top></td>
    </tr>
  </table>
</div>
<div id=box2 style='overflow:hidden;height:120px;width:700px;color:#ff0000'>
  <table align=left cellpadding=0 cellspace=0 border=0>
    <tr>
      <td id=pic21 valign=top><table border=0 cellpadding=0 cellspacing=0>
          <tr>
            <td><a href=http://www.fankelipinka.com target=_blank><img border=0 src="4.jpg" width=150 height=100 hspace=22></a><br>
              <center>
                <b>说明一</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.wangtx.com target=_blank><img border=0 src="5.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明二</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.yamaxun.org target=_blank><img border=0 src="2.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明三</b>
              </center></td>
            <td><a href=http://www.cnwenger.com target=_blank><img border=0 src="3.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明四</b>
              </center></td>
            <td width=30></td>
            <td><a href=http://www.pc555.com target=_blank><img border=0 src="1.jpg" width=150 height=100  hspace=22></a><br>
              <center>
                <b>说明五</b>
              </center></td>
          </tr>
        </table></td>
      <td id=pic22 valign=top></td>
    </tr>
  </table>
</div>
<script>
  var speed=10//速度数值越大速度越慢
  function Marquee(i){
  var pic=document.getElementById('pic'+i+'1');
  var box=document.getElementById('box'+i);
	  if(pic.offsetWidth-box.scrollLeft<=0)
		  box.scrollLeft-=pic.offsetWidth
	  else{
		  box.scrollLeft++
	  }
  }
  function loadRun(i){
			var cmd="pic"+i+"2.innerHTML=pic"+i+"1.innerHTML;";
			cmd+="var M"+i+"=setInterval(function(){Marquee("+i+");},speed);";
			cmd+="box"+i+".οnmοuseοver=function() {clearInterval(M"+i+")};";
			cmd+="box"+i+".οnmοuseοut=function() {M"+i+"=setInterval(function(){Marquee("+i+");},speed)};";eval(cmd);
  }
  for(var i=0;i<3;i++)
  loadRun(i);
  
  </script>
</body>
</html>

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值