<
script language
=
javascript
>
<!--
scrollpertime1 = 16 ; // 每次滚动高度,象素,scrollpertime1乘10必须小于scrollinterval1
scrollinterval1 = 5000 ; // 滚动间隔,毫秒
stopscroll1 = false ; // 这个变量控制是否停止滚动
scrollcount1 = 0 ; // 这个变量用于平滑滚动
//
var upDIV1 = document.all.firstDiv1;
var downDIV1 = document.all.secendDiv1;
var sing_h1 = 0 ;
with (document.all.mainDiv1)
... {
onmouseover=new Function("stopscroll1=true"); //鼠标经过,停止滚动
onmouseout=new Function("stopscroll1=false"); //鼠标离开,开始滚动
}
// 这时候,内容区的高度是无法读取了。下面输出一个不可见的层"templayer",稍后将内容复制到里面:
function inits1()
... { //初始化滚动内容
sing_h1=document.all.firstDiv1.offsetHeight
if(sing_h1<=0)...{
setTimeout("inits1()",20);
return;
}
document.all.secendDiv1.style.top=sing_h1;
document.all.secendDiv1.innerHTML+=document.all.firstDiv1.innerHTML;
//设置连续超时,调用"scrollUp1()"函数驱动滚动条:
setInterval("scrollUp1()",scrollinterval1);
}
function scrollUp1()
... { //滚动条的驱动函数
if(stopscroll1==true && scrollcount1==0) return; //如果变量"stopscroll1"为真,则停止滚动
if(scrollcount1<scrollpertime1)
...{
if(upDIV1.style.top=="")...{
var prevTop1=0;
} else ...{
var prevTop1=parseInt(upDIV1.style.top)
}
if(downDIV1.style.top=="")...{
var prevTop2=0;
} else ...{
var prevTop2=parseInt(downDIV1.style.top)
}
upDIV1.style.top=prevTop1-1;
downDIV1.style.top=prevTop2-1;
scrollcount1++;
if(parseInt(upDIV1.style.top)<=-sing_h1)...{
upDIV1.style.top=parseInt(downDIV1.style.top)+sing_h1
var temp=upDIV1;
upDIV1=downDIV1;
downDIV1=temp;
}
//alert(upDIV1.style.top)
setTimeout("scrollUp1()",20);
}
else
...{
scrollcount1=0;
}
}
// setTimeout("scrollUp1()",20);
inits1();
-->
</ script >
<!--
scrollpertime1 = 16 ; // 每次滚动高度,象素,scrollpertime1乘10必须小于scrollinterval1
scrollinterval1 = 5000 ; // 滚动间隔,毫秒
stopscroll1 = false ; // 这个变量控制是否停止滚动
scrollcount1 = 0 ; // 这个变量用于平滑滚动
//
var upDIV1 = document.all.firstDiv1;
var downDIV1 = document.all.secendDiv1;
var sing_h1 = 0 ;
with (document.all.mainDiv1)
... {
onmouseover=new Function("stopscroll1=true"); //鼠标经过,停止滚动
onmouseout=new Function("stopscroll1=false"); //鼠标离开,开始滚动
}
// 这时候,内容区的高度是无法读取了。下面输出一个不可见的层"templayer",稍后将内容复制到里面:
function inits1()
... { //初始化滚动内容
sing_h1=document.all.firstDiv1.offsetHeight
if(sing_h1<=0)...{
setTimeout("inits1()",20);
return;
}
document.all.secendDiv1.style.top=sing_h1;
document.all.secendDiv1.innerHTML+=document.all.firstDiv1.innerHTML;
//设置连续超时,调用"scrollUp1()"函数驱动滚动条:
setInterval("scrollUp1()",scrollinterval1);
}
function scrollUp1()
... { //滚动条的驱动函数
if(stopscroll1==true && scrollcount1==0) return; //如果变量"stopscroll1"为真,则停止滚动
if(scrollcount1<scrollpertime1)
...{
if(upDIV1.style.top=="")...{
var prevTop1=0;
} else ...{
var prevTop1=parseInt(upDIV1.style.top)
}
if(downDIV1.style.top=="")...{
var prevTop2=0;
} else ...{
var prevTop2=parseInt(downDIV1.style.top)
}
upDIV1.style.top=prevTop1-1;
downDIV1.style.top=prevTop2-1;
scrollcount1++;
if(parseInt(upDIV1.style.top)<=-sing_h1)...{
upDIV1.style.top=parseInt(downDIV1.style.top)+sing_h1
var temp=upDIV1;
upDIV1=downDIV1;
downDIV1=temp;
}
//alert(upDIV1.style.top)
setTimeout("scrollUp1()",20);
}
else
...{
scrollcount1=0;
}
}
// setTimeout("scrollUp1()",20);
inits1();
-->
</ script >