zoukankan      html  css  js  c++  java
  • JS实现定时循环上翻

    <html>
    <body>
    <DIV align="center" id="icefable2">
    <table width='472' border='0' cellpadding='0' cellspacing='0'>
    <tr><td height='113'>QQQQQQQQQQQQQQQQQQQQQQQq</td></tr>
    <tr><td height='113'>KKKKKKKKKKKKKKKKKKKKKKKK</td></tr>
    </table>
    </div>
    <Script language="JavaScript">
     marqueesHeight
    =113;
      stopscroll1
    =false;
      
    with(icefable2){
       style.width
    =0;
       style.height
    =marqueesHeight;
       style.overflowX
    ="visible";
       style.overflowY
    ="hidden";
       noWrap
    =true;
       onmouseover
    =new Function("stopscroll1=true");
       onmouseout
    =new Function("stopscroll1=false");
      }
      preTop1
    =0; currentTop1=113; stoptime1=0;
      icefable2.innerHTML
    +=icefable2.innerHTML;


    function init_srolltext(){
      icefable2.scrollTop
    =0;
      setInterval(
    "scrollUp1()",2);
    }init_srolltext();

    function scrollUp1(){
      
    if(stopscroll1==truereturn;
      currentTop1
    +=1;
      
    if(currentTop1==114)
      {
       stoptime1
    +=1;
       currentTop1
    -=1;
       
    if(stoptime1==300)
       {
        currentTop1
    =0;
        stoptime1
    =0;
       }
      }
      
    else {
       preTop1
    =icefable2.scrollTop;
       icefable2.scrollTop
    +=1;
       
    if(preTop1==icefable2.scrollTop){
         icefable2.scrollTop
    =113;
         icefable2.scrollTop
    +=1;

       }
      }
    }
    //-->
    </script>
    </body>
    </html>
  • 相关阅读:
    数据结构-线性表-链表
    [poj 2991]Crane[线段树表示向量之和,而非数量]
    vector要注意的点
    vector与deque的区别
    sendfile复习
    GPU和CPU的区别
    常用Linux命令 mount df dd
    可省略的关键字
    父类与子类的virtual
    加快编译的技巧 & mount及tmpfs
  • 原文地址:https://www.cnblogs.com/ding0910/p/512120.html
Copyright © 2011-2022 走看看