谁帮我改改这个代码

canzai 2008-11-10 02:31:29
代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang=it dir=ltr xml:lang="it" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>css+js控制文字滚动 </title>
<script language="javascript">
<!--
function scrollup(o,d,c)
{
if(d==c)
{
var t=o.firstChild.cloneNode(true);
o.removeChild(o.firstChild);o.appendChild(t);
t.style.marginLeft=o.firstChild.style.marginLeft='0px';
hscroll(o);
}
else
{
ch=false;var s=3,c=c+s,l=(c>=d?c-d:0);
o.firstChild.style.marginLeft=-c+l+'px';
window.setTimeout(function(){scrollup(o,d,c-l)},50);//50改变滚动速度的
}
}
function hscroll(o)
{
var w1=o.firstChild.offsetHeight,w2=o.offsetHeight;
if(w1 <=w2)return;
tc=window.setTimeout(function(){hs(o,w1-w2,0,w1-w2)},3500);
}
function hs(o,d,c,p)
{
c++;var t=(c>0?-c:c);o.firstChild.style.marginTop=t+'px';
if(c==d)
{
if(d==0)
{
tc=window.setTimeout(function(){hs(o,p,0,p)},2500);
}
else
tc=window.setTimeout(function(){hs(o,0,-p,p)},3500);
}
else
tc=window.setTimeout(function(){hs(o,d,c,p)},5);
}
//-->
</script>
</head>
<body>
<div id="UpInfo" style="overflow:hidden; text-align:left; height:20px; width:444px;">
<div style="float:left; width:444px;">开11111111111完 </div>
<div style="float:left; width:444px;">开22222222222完 </div>
<div style="float:left; width:444px;">开33333333333333完 </div>
<div style="float:left; width:444px;">开4444444444444完 </div>
<div style="float:left; width:444px;">开55555555555555555555 </div>
<div style="float:left; width:444px;">开66666666完 </div>
<div style="float:left; width:444px;">开77777777777完 </div>
<div style="float:left; width:444px;">开88888888888888888888888888完 </div>
<div style="float:left; width:444px;">开999999999999完 </div>
<div style="float:left; width:444px;">开000000000完 </div>
</div>
<script language="javascript">
var tc;
window.onload=function()
{
var o=document.getElementById('UpInfo');hscroll(o);
window.setInterval(function(){window.clearTimeout(tc);o.firstChild.style.marginTop='0px';scrollup(o,40,0);},3000);
}
</script>
</body>
</html>

...全文
39 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiubin200236 2008-11-10
  • 打赏
  • 举报
回复
看看这个把,你需要的
http://www.cnblogs.com/cloudgamer/archive/2008/04/30/1177682.html
http://www.cnblogs.com/cloudgamer/archive/2008/04/29/1176618.html
canzai 2008-11-10
  • 打赏
  • 举报
回复
在显示每一条的时候要从右边滚动到左边,直到一条标题全部显示出来后停住一会儿,再滚动走掉,
而目前是直接把整条标题显示出来后(主要是改这里,不要一下子全显示,要从右到左慢慢滚动出来),停顿一下再滚动走掉

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧