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==true) return;
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>
<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==true) return;
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>