<!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=demo style=overflow:hidden;height:100;width:90;background:#214984;color:#ffffff>
  <div id=demo1>
  <img src="images/product/featured_product/DSC00017_s.jpg" width="105" height="130">
  <img src="images/product/featured_product/DSC00018_s.jpg" width="122" height="130">
  <img src="images/product/featured_product/DSC00025_s.jpg" width="108" height="130">
  <img src="images/product/featured_product/DSC00109_s.jpg" width="118" height="130">
  <img src="images/product/featured_product/DSC00094_s.jpg" width="113" height="130"></div>
  <div id=demo2></div>
  </div>
    <script>
    var speed=30
    demo2.innerHTML=demo1.innerHTML
    demo.scrollTop=demo.scrollHeight
    function Marquee(){
    if(demo1.offsetTop-demo.scrollTop>=0)
    demo.scrollTop+=demo2.offsetHeight
    else{
    demo.scrollTop--
    }
    }
    var MyMar=setInterval(Marquee,speed)
    demo.onmouseover=function() {clearInterval(MyMar)}
    demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    </script>
</body>
</html>

解决方案 »

  1.   

    <!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=demo style=overflow:hidden;height:100;width:90;background:#214984;color:#ffffff>
      <div id=demo1>
      <img src="images/product/featured_product/DSC00017_s.jpg" width="105" height="130"><img src="images/product/featured_product/DSC00018_s.jpg" width="122" height="130"><img src="images/product/featured_product/DSC00025_s.jpg" width="108" height="130"><img src="images/product/featured_product/DSC00109_s.jpg" width="118" height="130"><img src="images/product/featured_product/DSC00094_s.jpg" width="113" height="130"></div>
      <div id=demo2><a href="http://www.svnhost.cn">开源社区</a></div>
      </div>
        <script>
        var speed=30
        demo2.innerHTML=demo1.innerHTML
        demo.scrollTop=demo.scrollHeight
        function Marquee(){
        if(demo1.offsetTop-demo.scrollTop>=0)
        demo.scrollTop+=demo2.offsetHeight
        else{
        demo.scrollTop--
        }
        }
        var MyMar=setInterval(Marquee,speed)
        demo.onmouseover=function() {clearInterval(MyMar)}
        demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
        </script>
    </body>
    </html>