找回密码
 注册
搜索
热搜: java php web
查看: 2578|回复: 2

帮我看个javascript写得程序

[复制链接]
发表于 2009-1-27 18:15:10 | 显示全部楼层 |阅读模式
<body onload="movetext">

<table width="90%" height="60" border="0" >
<tr >
<td><span id="a1">就</span></td>
<td><span id="a2">这</span></td>
<td><span id="a3">样</span></td>
<td><span id="a4">的</span></td>
<td><span id="a5">离</span></td>
<td><span id="a6">开</span></td>
</tr>
</table>
<script languae="JavaScript">
<!--
function movetext(){
document.all.a1.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a1.style.lineHeight=1.2;
c1=Math.floor(Math.random()*256);
c2=Math.floor(Math.random()*256);
c3=Math.floor(Math.random()*256);
document.all.a1.style.color="rgb("+c1+","+c2+","+c3+")";
document.all.a2.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a2.style.lineHeight=1.2;
document.all.a2.style.color="rgb("+c2+","+c1+","+c3+")";
document.all.a3.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a3.style.lineHeight=1.2;
document.all.a3.style.color="rgb("+c3+","+c2+","+c1+")";

document.all.a4.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a4.style.lineHeight=1.2;
document.all.a4.style.color="rgb("+c2+","+c3+","+c1+")";
document.all.a5.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a5.style.lineHeight=1.2;
document.all.a5.style.color="rgb("+c1+","+c3+","+c2+")";
document.all.a6.style.fontSize=16+Math.floor(Math.random()*24);
document.all.a6.style.lineHeight=1.2;
document.all.a6.style.color="rgb("+c3+","+c2+","+c1+")";
timer=setTimeout("movetext()",300);
}
-->
</script>


</body>//我的目的是让“就这样离开”这几个文字出现跳动,并且改变颜色。怎么不会运行呀?
发表于 2009-1-27 20:01:17 | 显示全部楼层
将<script type="text/javascript">movetext();</script>
回复

使用道具 举报

发表于 2009-1-27 19:10:29 | 显示全部楼层
回复 2# 的帖子
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|软晨网(RuanChen.com)

GMT+8, 2024-11-23 05:57

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表