• 非常棒的图片连续滚动代码


    <!--//向左滚动代码开始-->
    <style type="text/css">
    body{margin:0px auto; padding:0px;}
    ul,li{margin:0px; padding:0px;list-style:none;}
    .sqBorder {602px; height:64px; padding:10px; border:1px #000000 solid; background:#555555;}
    .scroll_div {600px; height:62px;margin:0 auto; overflow: hidden; white-space: nowrap; background:#ffffff;}
    .scroll_div img {120px;height:60px;border: 0;margin: auto 8px; border:1px #efefef solid;}
    #scroll_begin, #scroll_end, #scroll_begin ul, #scroll_end ul, #scroll_begin ul li, #scroll_end ul li{display:inline;}/*设置ul和li横排*/
    </style>
    <script language="javascript">
    function ScrollImgLeft(){
    var speed=20
    var scroll_begin = document.getElementById("scroll_begin");
    var scroll_end = document.getElementById("scroll_end");
    var scroll_div = document.getElementById("scroll_div");
    scroll_end.innerHTML=scroll_begin.innerHTML
      function Marquee(){
        if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
          scroll_div.scrollLeft-=scroll_begin.offsetWidth
        else
          scroll_div.scrollLeft++
      }
    var MyMar=setInterval(Marquee,speed)
      scroll_div.onmouseover=function() {clearInterval(MyMar)}
      scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
    }
    </script>
    <h2 align="center">向左滚动</h2>
    <div style="text-align:center">
      <div class="sqBorder">
      <!--#####滚动区域#####-->
        <div id="scroll_div" class="scroll_div">
          <div id="scroll_begin">
            <ul>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
              <li><a href="http://www.1netmedia.net/"><img src="http://www.1netmedia.net/images/main_logo.gif" alt="『一网传媒』" /></a></li>
            </ul>
          </div>
          <div id="scroll_end"></div>
        </div>
      <!--#####滚动区域#####-->
      </div>
      <script type="text/javascript">ScrollImgLeft();</script>
    </div>
    <!--//向左滚动代码结束-->
  • 相关阅读:
    第十六周个人作业
    小组作业
    第十五周个人作业
    本周个人总结
    产品计划会议
    本周个人总结
    排球计分程序
    JProfiler入门
    (转)MMOGS服务器架构设计
    (转)游戏服务器开发需要学习的技术
  • 原文地址:https://www.cnblogs.com/juan/p/1452511.html
Copyright © 2020-2023  润新知