让我们一起爱米兰
站内搜搜:
移动设备
请扫描二维码
或访问
m.milan100.com
您所在的位置 -> 米兰百分百 -> JAVASCRIPT -> js滚屏代码,隔一段时间向上滚动

js滚屏代码,隔一段时间向上滚动

点击数:1584 发表时间:2010-07-07 15:25:14 作者: 来源链接:
分享到:
分享到微信

 

<div id="icefable1">

内容...........

</div>

<SCRIPT>
   marqueesHeight=140;
   stopscroll=false;
   with(icefable1){
      style.width=380;
      style.height=marqueesHeight;
      style.overflowX="visible";
      style.overflowY="hidden";
      noWrap=true;
      onmouseover=new Function("stopscroll=true");
      onmouseout=new Function("stopscroll=false");
     }
     preTop=0; currentTop=80; 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==118)
     {
    stoptime+=1;
    currentTop-=1;
    if(stoptime==100)
    {
     currentTop=0;
     stoptime=0;    
    }
     }
     else {   
      preTop=icefable1.scrollTop;
      icefable1.scrollTop+=1;
      if(preTop==icefable1.scrollTop){
     icefable1.scrollTop=110;
     icefable1.scrollTop+=10;
     
      }
     }
   
   }
   </SCRIPT>

0
很 好
0
一 般
5
差 劲
热门新闻
相关文章
上一篇: js技巧收集(200多个)
下一篇: JavaScript(js)字符串替换函数replace的用法
评论区
匿名

返回首页 | 收藏本页 | 回到顶部
Copyright 2010. 米兰百分百 Powered By Bridge.
京ICP备15050557号