my name is tomzhou! hello,ipaddr hello,bcomcn my name is tomzhou2! hello,ipaddr2 hello,bcomcn2 |
var scrolling=0;
var t=scrollcont.scrolltop;
scrollcont2.innerhtml=scrollcont1.innerhtml;
function scrollshow()
{
if (scrolling==1) return;
if (scrollcont2.offsettop-scrollcont.scrolltop<=0)
scrollcont.scrolltop-=scrollcont1.offsetheight;
else
scrollcont.scrolltop++;
}
setinterval(scrollshow,50);
[ctrl+a 全选 注:如需引入外部js需刷新才能执行]
其中,100px是滚动区域的高度,宽度由scrollcont的外面容器决定,setinterval里面的50决定滚动的速度。