新闻列表向上(下)翻滚效果(JS效果)
.shell{
width:600px;
}
.core{
height:25px;
line-height:25px;
overflow:hidden;
}
.core *{ color:#416180;}
<div class="shell">
<div id="div_indexNewList" class="core" runat="server">
</div>
</div>
<script type="text/javascript">
function myGod(id,w,n){
var box=document.getElementById(id),can=true,w=w||1500,fq=fq||10,n=n==-1?-1:1;
box.innerHTML+=box.innerHTML;
box.onmouseover=function(){can=false};
box.onmouseout=function(){can=true};
var max=parseInt(box.scrollHeight/2);
new function (){
var stop=box.scrollTop%18==0&&!can;
if(!stop){
var set=n>0?[max,0]:[0,max];
box.scrollTop==set[0]?box.scrollTop=set[1]:box.scrollTop+=n;
};
setTimeout(arguments.callee,box.scrollTop%25?fq:w);
};
};
//myGod('div1',10);
//myGod('div2',10,-1);
//myGod('div3',500,-1);
myGod('div_indexNewList',2000);
//myGod('div5',1500,-1);
</script>