图片轮播(普通)


          <div id=demo>
            <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0>
              <tr>
                <td valign=top id=marquePic1><table width='100%' border='0' cellspacing='0'>
                    <tr>
                      <td align=center><a title="" href="inside.html"><img src="images/t1.jpg" width="140" height="90" border=0 ></a><span><a title="" href="">办公环境</a></span></td>
                      <td align=center><a title="" href="inside.html"><img src="images/t2.jpg" width="140" height="90" border=0></a><span><a title="" href="">办公环境</a></span></td>
                      <td align=center><a title="" href="news2.html"><img src="images/luyou.jpg" width="140" height="90" border=0></a><span><a title="" href="">旅游照片</a></span></td>
                      <td align=center><a title="" href="inside.html"><img src="images/t1.jpg" width="140" height="90" border=0 ></a><span><a title="" href="">办公环境</a></span></td>
                      <td align=center><a title="" href="inside.html"><img src="images/t2.jpg" width="140" height="90" border=0></a><span><a title="" href="">办公环境</a></span></td>
                      <td align=center><a title="" href="news2.html"><img src="images/luyou.jpg" width="140" height="90" border=0></a><span><a title="" href="">旅游照片</a></span></td>
                      
                    </tr>
                  </table></td>
                <td id=marquePic2 valign=top></td>
              </tr>
            </table>
          </div>
          <script type="text/javascript">
	var speed=25 
	marquePic2.innerHTML=marquePic1.innerHTML 
	function Marquee(){ 
	  if(demo.scrollLeft>=marquePic1.scrollWidth){ 
	    demo.scrollLeft=0 
	  }else{ 
	    demo.scrollLeft++ 
	  } 
	} 
	var MyMar=setInterval(Marquee,speed) 
	demo.onmouseover=function() {clearInterval(MyMar)} 
	demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)} 
</script> 


你可能感兴趣的:(JavaScript,html)