当前位置:编程学习 > JS >>

向上 滚动一会儿停顿几秒的代码

<div id="icefable1">
    <dl>
      <dd><a href='/make.php?id=18699'><img alt='白色3D娃娃宝剑和盾牌banner在线设计' src='http://www.zhaoxi.net/images/mymake/2016/11/201701040052005244.gif'/></a></dd>
      <dd><a href='/make.php?id=18698'><img alt='苹果手机秒冲电池banner在线制作' src='http://www.zhaoxi.net/images/mymake/2016/12/201701040043004338.gif'/></a></dd>
      <dd><a href='/make.php?id=18691'><img alt='意大利进口爱心巧克力banner在线制作' src='http://www.zhaoxi.net/images/mymake/2016/8/201701030215021543.gif'/></a></dd>
      <dd><a href='/make.php?id=18679'><img alt='多媒体台式小音箱迷你低音炮banner生成' src='http://www.zhaoxi.net/images/mymake/2016/12/201612312337233704.gif'/></a></dd>
      <dd><a href='/make.php?id=18678'><img alt='白色免洗牛皮运动鞋banner设计器' src='http://www.zhaoxi.net/images/mymake/2016/12/201612312328232817.gif'/></a></dd>
      <dd><a href='/make.php?id=18673'><img alt='深层补水保湿护肤品banner在线制作' src='http://www.zhaoxi.net/images/mymake/2016/12/201612302356235638.gif'/></a></dd>
    </dl>
</DIV>
<script>
marqueesHeight=300; 
stopscroll=false; 

with(icefable1){    
style.width=800;   
style.height=marqueesHeight;    
style.overflowX="visible";    
style.overflowY="hidden";    
noWrap=true;    
onmouseover=new Function("stopscroll=true");    
onmouseout=new Function("stopscroll=false");   
}   
preTop=0; currentTop=290; stoptime=0;   
icefable1.innerHTML+=icefable1.innerHTML;   

function init_srolltext(){   
icefable1.scrollTop=0;   
setInterval("scrollUp()",30); }
init_srolltext();

function scrollUp(){   
if(stopscroll==true) return;   
currentTop+=1;   if(currentTop==291)   {    
stoptime+=1;    
currentTop-=1;    
if(stoptime==289)    {     currentTop=0;     stoptime=0;        }  
 }   else {     
  preTop=icefable1.scrollTop;    icefable1.scrollTop+=1;    
  if(preTop==icefable1.scrollTop){      icefable1.scrollTop=290;      icefable1.scrollTop+=1;         }   }

}                
</script>
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,