<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>建站代码-上下翻滚JS</title>

</head>

<body>
<div ;
       style.overflow = 'hidden';
       noWrap          = true;
      }

      scrollId.onmouseover = new Function('stopscroll = true');
      scrollId.onmouseout = new Function('stopscroll = false');

      preTop     = 0;
      currentTop = 0;
      stoptime   = 0;
      alert( scrollId.scrollHeight);
      if(height < scrollId.scrollHeight){
          leftElem = document.getElementById(marqueId);
          //alert(leftElem.cloneNode(true));
          scrollId.appendChild(leftElem.cloneNode(true)); //cloneNode(true) 如果这个布尔参数设置为 true,被克隆的节点会复制原始节点的所有子节点。
           
          init_srolltext();
      }
   }catch(e) {}
}

function init_srolltext(){
scrollId.scrollTop = 0;
setInterval('scrollUp()', 18);
}

function scrollUp(){
if(stopscroll) return;
currentTop += 1;
if(currentTop == marqueesHeight+1) {
    stoptime += 1;
    currentTop -= 1;
    if(stoptime == (marqueesHeight)*1) {//??
      currentTop = 0;
      stoptime = 0;
    }
}else{

    preTop = scrollId.scrollTop;    //网页被卷去的高
   //alert(preTop);
    scrollId.scrollTop += 1;
    if(preTop == scrollId.scrollTop){
      scrollId.scrollTop = marqueesHeight;
      scrollId.scrollTop += 1;
    }
}
}
</script>


</body>
</html>

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-10-20
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案