變色的旋轉(zhuǎn)圓圈
<script language="JavaScript">
var CoLoUrS=new Array('ff0000','ffffff','0000ff','ffffff');
var dots=16;
var ThingsInArray;
var step=0.3;
var a_StEp=0.05;
var RunTime=0;
var currStep = 0;
var Xpos = 0;
var Ypos = 0;
var cntr=70;
var count_a=0;
var move_a=1;
var curColour;
var count=0;
var move=1;
var brwsr=(document.layers)?1:0;
if (brwsr){
for (i=0; i < dots; i++){
document.write('
');
}
var x = document;
ThingsInArray=new Array(x.a0,x.a1,x.a2,x.a3,x.a4,x.a5,x.a6,x.a7,x.a8,x.a9,x.a10,x.a11,x.a12,x.a13,x.a14,x.a15)
}
else{
document.write('
');
for (i=0; i < dots; i++){
document.write('
');
}
document.write('
');
var x = ieDiv.all.c.all;
ThingsInArray=new Array(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15])
}
function colourStep(){
count+=move;
if (count >= ThingsInArray.length) {count=0;count_a+=move}
if (count_a == CoLoUrS.length) count_a=0;
if (brwsr) ThingsInArray[count].bgColor=CoLoUrS[count_a];
else ThingsInArray[count].style.background=CoLoUrS[count_a];
setTimeout('colourStep()',100)
}
function moveAbout(){
if (brwsr){
Ypos = window.pageYOffset+window.innerHeight/2 + window.innerHeight/3.1 * Math.cos((RunTime)/3)*Math.cos(RunTime/50);
Xpos = window.pageXOffset+window.innerWidth/2 + window.innerWidth/2.4 * Math.sin((RunTime)/5)*Math.cos(RunTime/30);
}
else{
Ypos = document.body.scrollTop+document.body.offsetHeight/2 + document.body.offsetHeight/2.8*Math.cos((RunTime)/3)*Math.cos(RunTime/10);
Xpos= document.body.scrollLeft+document.body.offsetWidth/2 + document.body.offsetWidth/2.4*Math.sin((RunTime)/5)*Math.sin(RunTime/20);
}
RunTime+=a_StEp;
Tma=setTimeout("moveAbout()", 10);
}
function TwistnSpin(){
if (brwsr){
for ( i = 0 ; i < 16 ; i++ )
{
var templayer="a"+i
document.layers[templayer].top = Ypos+cntr*Math.cos((currStep + i*4)/10.2)*Math.cos(currStep/10)
document.layers[templayer].left =Xpos+cntr*Math.sin((currStep + i*4)/10.2);
}
}
else{
for (i=0;i
=70)
{clearTimeout(GoSwell);Shrink()}
}
function StArTuP(){
moveAbout();
TwistnSpin();
Shrink();
colourStep();
}
StArTuP();
</script>