Home  >  Article  >  Web Front-end  >  图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:28:491168browse

代码如下:

 

Code
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档



<script> <br />function ScrollImgLeft(){ <br />var speed=5 <br />var scroll_begin = document.getElementById("scroll_begin"); <br />var scroll_end = document.getElementById("scroll_end"); <br />var scroll_div = document.getElementById("scroll_div"); <br />scroll_end.innerHTML=scroll_begin.innerHTML <br />function Marquee(){ <br /> if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0) <br /> scroll_div.scrollLeft-=scroll_begin.offsetWidth <br /> else <br /> scroll_div.scrollLeft++ <br />} <br />var MyMar=setInterval(Marquee,speed) <br />scroll_div.onmouseover=function() {clearInterval(MyMar)} <br />scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)} <br />} <br /></script>
    
    

      

        

              
  • 图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

  •           
  • 图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

  •           
  • 图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

  •           
  • 图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

  •           
  • 图片横向不间断滚动代码(div+css)_html/css_WEB-ITnose

  •         
            

      

      

    

    
<script>ScrollImgLeft();</script>


 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn