背景图片,颜色变化脚本
背景随机显示
<SCRIPT language=javascript><br>
<!--<br>
bg = new Array(2); //设定图片数量,如果图片数为3,这个参数就设为2,依次类推<br>
bg[0] = ’bag.gif’ //显示的图片路径,可用http://<br>
bg[1] = ’yellow.gif’<br>
bg[2] = ’xinxin.gif’<br> //代码来自:www.net0and1.com
index = Math.floor(Math.random() * bg.length);<br>
document.write("<BODY BACKGROUND="+bg[index]+">");<br>
<br>
//--><br>
<br>
<br>
</SCRIPT>
背景不停变化脚本
<SCRIPT language=javascript><!--<br>
<br>
var pos=10;function initArray(){this.length=initArray.arguments.length;<br>
<br>
for(var i=0;i<this.length;i++)}<br>
<br>
var col=new initArray("4b","5b","8b","8b");<br>
<br>
col[0]="yellow";col[1]="coral";col[2]="orange";col[3]="red";<br>
<br>
col[4]="greenyellow";col[5]="lime";col[6]="turquoise";col[7]="coral";<br>
<br>
col[8]="blueviolet";col[9]="violet";<br>
<br>
function chgCol()document.bgColor=col[pos];<br>
<br>
setTimeout("chgCol()",3000);/*这里你可以改变时间间隔.*/<br>
<br>
}<br>/*代码来自www.net0and1.com*/
<br>
var yourwords="不断变化背景色彩";var buffer1=" ";<br>
<br>
var buffer2=" ";<br>
<br>
var message1=buffer1+yourwords+buffer2;<br>
<br>
var dir="left";var speed=150;function pingpong(){<br>
<br>
if(dir=="left")<br>
<br>
{message2=message1.substring(2,message1.length)+" ";<br>
<br>
window.status=message2;setTimeout("pingpong();",speed);message1=message2;<br>
<br>
if(message1.substring(0,1)=="*")dir="right";}<br>
<br>
else{message2=" "+message1.substring(0,message1.length-2);<br>
<br>
window.status=message2;setTimeout("pingpong();",speed);<br>
<br>
message1=message2;if(message1.substring(message1.length-1,message1.length)=="*")dir="left";}}//<br>
<br>
--><br>
<br>
</SCRIPT><br>
<br>
<br>
<body bgColor=#ffffff onload="chgCol(); pingpong();">