までを
内に入れ // に onload="background()" を追加する // *********************** 個別設定 +++++++++++++++++++++++++ // // 背景にする画像(相対パス or 絶対パス / 最後は , を入れない) BG = new Array( "./files/back1.gif", "./files/back2.gif", "./files/back3.gif" ); // 表示位置(X座標 Y座標を半角スペースで分ける / 単位:[ px | % | em | pt ] ) POS = "0% 0%"; // 背景の繰り返し(repeat | repeat-x | repeat-y | no-repeat) REP = "repeat"; // 背景の固定(fixed:固定 | scroll:非固定) ANC = "scroll" // ************************ 設定終了************************* // // 内部処理 BGN = Math.floor(Math.random()*BG.length); BGI = "url('" + BG[BGN] + "')" function background() { if (document.body) { // document.bodyが実行できない場合は無視 document.body.style.backgroundImage = BGI; document.body.style.backgroundPosition = POS; document.body.style.backgroundRepeat = REP; document.body.style.backgroundAttachment = ANC } } // -->