网站建设_深圳网站建设_深圳网页制作_深圳网络公司 不仅仅是网站建设,不一样的品牌建站专家
繁體 | 用户登录 | 免费注册 | 客户支持 | 交费方式

销售热线: 0755-88822234  技术支持:13728743193

深圳网站建设,深圳网页制作,深圳网站制作,企业网站建设
快速导航
热文排行
臻心动态
网站优化
网站推广
JS无间隙滚动[支持多个自定义滚动代码]    返回
时间:2020-4-4    来自:深圳市臻心网络科技有限公司

jinshimove(d1,d2,d3,e,Cspeed)
d1 = 外围容器
d2 = 内容
d3 = 复制d2的内容接替循环滚动
e   = 方向与方法
   1,2,3,4 = 自动滚动,分别对应:上,右,下,左
   "top","right","bottom","left" = 手动滚动,分别对应:上,右,下,左

Cspeed=速度

--------------JS代码如下--------------

<script type="text/javascript">
function jinshimove(d1,d2,d3,e,Cspeed){ 
var speed = Cspeed;
    var demo=document.getElementById(d1); 
    var demo1=document.getElementById(d2); 
    var demo2=document.getElementById(d3); 
    demo2.innerHTML=demo1.innerHTML; 
    function boxTop(){ 
            if(demo2.offsetTop-demo.scrollTop<=0){demo.scrollTop-=demo1.offsetHeight} 
            else{demo.scrollTop++} 
        } 
    function boxRight(){ 
            if(demo.scrollLeft<=0){demo.scrollLeft+=demo2.offsetWidth} 
            else{demo.scrollLeft--} 
        } 
    function boxBottom(){ 
            if(demo1.offsetTop-demo.scrollTop>=0){demo.scrollTop+=demo2.offsetHeight} 
            else{demo.scrollTop--} 
        } 
    function boxLeft(){ 
            if(demo2.offsetWidth-demo.scrollLeft<=0){demo.scrollLeft-=demo1.offsetWidth} 
            else{demo.scrollLeft++} 
        } 
    if(e==1){ 
            var MoveTop=setInterval(boxTop,speed); 
            demo.onmouseover=function(){clearInterval(MoveTop);} 
            demo.onmouseout=function(){MoveTop=setInterval(boxTop,speed)} 
        } 

{nextpage}
    if(e==2){ 
            var MoveRight=setInterval(boxRight,speed); 
            demo.onmouseover=function(){clearInterval(MoveRight)} 
            demo.onmouseout=function(){MoveRight=setInterval(boxRight,speed)} 
        } 
    if(e==3){ 
            var MoveBottom=setInterval(boxBottom,speed); 
            demo.onmouseover=function(){clearInterval(MoveBottom);} 
            demo.onmouseout=function(){MoveBottom=setInterval(boxBottom,speed)} 
        } 
    if(e==4){ 
            var MoveLeft=setInterval(boxLeft,speed) 
            demo.onmouseover=function(){clearInterval(MoveLeft)} 
            demo.onmouseout=function(){MoveLeft=setInterval(boxLeft,speed)} 
        } 
    if(e=="top"){ 
            MoveTop=setInterval(boxTop,speed) 
            demo.onmouseout=function(){clearInterval(MoveTop);} 
        } 
    if(e=="right"){ 
            MoveRight=setInterval(boxRight,speed) 
            demo.onmouseout=function(){clearInterval(MoveRight);} 
        } 
    if(e=="bottom"){ 
            MoveBottom=setInterval(boxBottom,speed) 
            demo.onmouseout=function(){clearInterval(MoveBottom);} 
        } 
    if(e=="left"){ 
            MoveLeft=setInterval(boxLeft,speed) 
            demo.onmouseout=function(){clearInterval(MoveLeft);} 
        } 
    }   
</script>

{nextpage}
--------------调用代码如下--------------

<div id="v0" style="overflow:hidden;height:170px;width:790px;" align="center">
      <div id="v1">
        <div>
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              
              <td> <td><img src="5.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="4.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="5.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="4.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="5.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="4.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="5.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="4.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="5.gif" width="301" height="170" alt="" />
                
              <td> <td><img src="4.gif" width="301" height="170" alt="" />
                
              </tr>
          </table>
        </div>
      </div>
      <div id="v2"></div>
    </div>

<script type="text/javascript">jinshimove("v0","v1","v2",4,30);</script>

香港优质医疗
香港方健医疗
泰国试管婴儿
洛阳网站建设
香港化验所
深圳SEO优化
深圳网站建设
泰国试管婴儿
香港安欣医疗
试管婴儿
泰国做试管婴儿
香港试管婴儿
香港安盛诊所
香港保险一站通
万利基因检测
爱心国际医疗
香港唯安医疗
版权所有 © 深圳市臻心网络科技有限公司 2006 - 2020
电话咨询:0755-88822234 网址:www.zhenx.net 手机:m.zhenx.net
版权所有,未经授权请勿复制及转载 粤ICP备19161554号