标题:html 实现图片从左向右不停的滑动(这个只能滑动再次)
只看楼主
伍则帝
Rank: 3Rank: 3
来 自:四川省南充市高坪区
等 级:论坛游民
威 望:6
帖 子:100
专家分:34
注 册:2013-3-16
结帖率:84%
已结贴  问题点数:10 回复次数:1 
html 实现图片从左向右不停的滑动(这个只能滑动再次)
<div id="list" class=" picutre_many"   
    style="overflow: hidden; height: 90px; width: 840px; margin:0 auto;">  
          <table cellspacing="0" cellpadding="0"      
               style="width: 680px; border: 0px;">      
                <tr>           
                     <td id="list1">                  
                      <table style="border: 0px;" cellpadding="0" cellspacing="0">            
                                 <tr id="pic">                    
                        <td><img style="border: 0px;" alt="" src="01c1eec4b74543a987b78c571e178a82bb0114d0[1].jpg"/></td>               
                        <td><img style="border: 0px;" alt="" src="1.PNG"/></td>            
                        <td><img style="border: 0px;" alt="" src="2cf7020828381f3096b15ca0a8014c086f06f06c[1].jpg" /></td>         
                        <td><img style="border: 0px;" alt="" src="2.PNG"/></td>         
                        <td><img style="border: 0px;" alt="" src="4ed4638e9cb3181662343f69bdae547e.jpg" /></td>                     
              </tr>         
                        </table>            
                           </td>            
                              <td id="list2"></td>      
                                    </tr>   
                                        </table>  
                                          </div>
                               <script type="text/javascript">       /*图片滚动效果*/      
    var speedpic = 20;//速度数值越大速度越慢
        document.getElementById("list2").innerHTML = document.getElementById("list1").innerHTML;   
            
function Marqueepic() {   
if (document.getElementById("list2").offsetWidth - document.getElementById("list").scrollLeft <= 0) {         
                        document.getElementById("list").scrollLeft -= document .getElementById("list1").offsetWidth;     
                        } else {            
                               document.getElementById("list").scrollLeft++;     
                                      }   
                                   }  
                                     var MyMarpic = setInterval(Marqueepic, speedpic);   
                                         document.getElementById("list").onmouseover = function() {     
                                                clearInterval(MyMarpic);        }     
                                                   document.getElementById("list").onmouseout = function() {   
                                                           MyMarpic = setInterval(Marqueepic, speedpic);        }  
                               </script>
搜索更多相关主题的帖子: hidden html border style 
2013-05-08 17:57
zp998
Rank: 2
来 自:江西
等 级:论坛游民
帖 子:27
专家分:48
注 册:2012-5-2
得分:10 
好好学习一下代码。
2013-05-08 20:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-406529-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.595178 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved