フェードイン(setInterval, document.bgColor)
<html> <head> <title>フェードイン</title> <script language="JavaScript"> <!-- i = 0; color = "0123456789ABCDEF"; function fade(){ //フェードイン col = color.charAt(i); document.bgColor = "#" + col + col + col + col + col + col; i++; if(i == 16) { //フェードイン終了 clearInterval(tm); } } function tm() { //タイマーセット document.bgColor = "#000000"; tm = setInterval("fade()", 100); } //--> </script> </head> <body onLoad="tm()"> <h1>ようこそ!!</h1> </body> </html>
〔 実行する 〕