<!-- 전체 HTML 파일은 다음과 같습니다. -->
<html>
<머리>
<title>웹사이트빌딩아카데미-특수효과코드->>색상이 변하는 회전원</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<본문 bgcolor=#FFFFFF>
<!------------------------------------------------ -->
<스크립트 언어="자바스크립트">
var CoLoUrS=new 배열('ff0000','ffffff','0000ff','ffffff');
var 도트=16;
varThingsInArray;
var 단계=0.3;
var a_StEp=0.05;
varRunTime=0;
varcurrStep = 0;
varXpos = 0;
var Ypos = 0;
var cntr=70;
var count_a=0;
var move_a=1;
var curColor;
변수 개수=0;
var 이동=1;
var brwsr=(document.layers)?1:0;
만약 (brwsr){
for (i=0; i < 점; i++){
document.write('<LAYER NAME="a'+i+'" LEFT=0 TOP=0 BGCOLOR=#ffffff CLIP="0,0,2,2"></LAYER>');
}
var x = 문서;
ThingsInArray=새 배열(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)
}
또 다른{
document.write('<div id="ieDiv" style="position:absolute;top:0px;left:0px"><div id="c" style="position:relative">');
for (i=0; i < 점; i++){
document.write('<div style="position:absolute;top:0px;left:0px;width:2px;height:2px; background:#ffffff;font-size:2px"></div>');
}
document.write('</div></div>');
var x = ieDiv.all.c.all;
ThingsInArray=새 배열(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])
}
함수 colorStep(){
카운트+=이동;
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('colorStep()',100)
}
함수 moveAbout(){
만약 (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);
}
또 다른{
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);
}
런타임+=a_StEp;
Tma=setTimeout("moveAbout()", 10);
}
함수 TwistnSpin(){
만약 (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);
}
}
또 다른{
(i=0;i<ieDiv.all.c.all.length;i++)
{
ieDiv.all.c.all[i].style.top = Ypos+cntr*Math.cos((currStep + i*4)/10.2)*Math.cos(currStep/10)
ieDiv.all.c.all[i].style.left= Xpos+cntr*Math.sin((currStep + i*4)/10.2);
}
}
currStep+=단계;
setTimeout("TwistnSpin()",10);
}
함수 축소(){
중앙값-=0.5;
GoShrink=setTimeout('Shrink()',10);
if (중심 <=20)
{clearTimeout(GoShrink);Swell()}
}
함수 스웰(){
cntr+=0.5;
GoSwell=setTimeout('Swell()',10);
if (중심 >=70)
{clearTimeout(GoSwell);Shrink()}
}
함수 StArTuP(){
moveAbout();
트위스트스핀();
수축();
colorStep();
}
StArTuP();
</script>
<!------------------------------------------------ -->
</body>
</html>