背景色を変化させる MENU


Source
    <html lang="ja"> <head> <title>yottete</title> <script language="JavaScript"> <!--- var sw = new Array(1,5,10); var rgb = new Array(0,0,0); var timer_is_set=false; function Mode16(n){ crgb=((n>255)? 255:((n<0)? 0:n)).toString(16); if(n<16)crgb="0"+crgb; return crgb; } function chg_bg_color(){ for(var i=0;i<3;i++) { sw[i] = (rgb[i]<=0)? x[i]:((rgb[i]>=255)? 0-sw[i]:sw[i]); sw[i] = (rgb[i]<=0 && sw[i]<0)? 0 - sw[i]:((rgb[i]>=255 && sw[i]>255)? 0-sw[i]:sw[i]); rgb[i] += sw[i]; } document.bgColor="#"+Mode16(rgb[0])+Mode16(rgb[1])+Mode16(rgb[2]); if (timer_is_set) clearTimeout(timer_ID); timer_ID=setTimeout("chg_bg_color()",200); Timer_is_set=true; } //---> </script> </head> <body onLoad="chg_bg_color()"> </body> </html>