复制代码 代码如下:
<script type="text/javascript">
var scrollDelay=10;//数字越大速度越慢
var Scroll=document.getElementById("scroll");
var Scroll2=document.getElementById("scroll2");
var currentTop=0,preTop=0,stoptime=0,stopscroll=false;
var ScrollChild=Scroll.getElementsByTagName("li");
var ScrollHeight=Scroll.offsetHeight;
function ScrollInfo(){
if(stopscroll==true) return;
currentTop++;
if(currentTop+1>=ScrollHeight){
currentTop--;
stoptime++;
if(stoptime==parseInt(ScrollHeight)*scrollDelay) {
currentTop=0;
stoptime=0;
}
}else{
preTop=Scroll.scrollTop;
Scroll.scrollTop++;
if(preTop==Scroll.scrollTop){
Scroll.scrollTop=Scroll2.offsetHeight-ScrollHeight;
Scroll.scrollTop+=1;
}
}
}
function Int_Scroll(){
Scroll2.innerHTML="";
Scroll2.innerHTML=Scroll.innerHTML;
Scroll.innerHTML=Scroll2.innerHTML+Scroll2.innerHTML;
Scroll.onmouseover=function(){
stopscroll=true;
}
Scroll.onmouseout=function(){
stopscroll=false;
}
setInterval("ScrollInfo()",scrollDelay);
}
window.setTimeout("Int_Scroll()",1000);
</script>


[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
标签:
js,数据,向上翻滚

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
评论“js数据向上翻滚_数据滚动”
暂无“js数据向上翻滚_数据滚动”评论...