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

代码如下:

 

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

无标题文档

.scroll_div {
width:660px;
height:146px;
margin:0 auto;
overflow: hidden;
white-space: nowrap;
background:#ffffff;
margin-left:-6px;
}
.scroll_div img {
width:128px;
height:140px;
border: 0;
margin: auto 2px;
border:3px #ccc solid;
}
#scroll_begin, #scroll_end, #scroll_begin ul, #scroll_end ul, #scroll_begin ul li, #scroll_end ul li {
display:inline;
}/*设置ul和li横排*/

function ScrollImgLeft(){
var speed=5
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)}
}

    
    
      
        
          图片横向不间断滚动代码(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
        
        
      
      
    
    
ScrollImgLeft();

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/3089018.html

(0)
上一篇 2025年3月28日 10:14:49
下一篇 2025年3月28日 10:15:05

AD推荐 黄金广告位招租... 更多推荐

发表回复

登录后才能评论