<!---- [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ----> <SCRIPT LANGUAGE="JavaScript"> <!-- function backcolor(form) { temp = "" for (var i = 0; i < 16; i++) { temp = form.color[i].value if (form.color[i].checked){ document.bgColor = temp } } } function randombackground() { document.bgColor = getColor() } function getColor(){ currentdate = new Date() backgroundcolor = currentdate.getSeconds() if (backgroundcolor > 44) backgroundcolor = backgroundcolor - 45 else if (backgroundcolor > 29) backgroundcolor = backgroundcolor - 30 else if (backgroundcolor > 15) backgroundcolor = backgroundcolor - 16 if (backgroundcolor == 0 ) return "olive"; else if (backgroundcolor == 1 ) return "teal"; else if (backgroundcolor == 2 ) return "red"; else if (backgroundcolor == 3 ) return "blue"; else if (backgroundcolor == 4 ) return "maroon"; else if (backgroundcolor == 5 ) return "navy"; else if (backgroundcolor == 6 ) return "lime"; else if (backgroundcolor == 7 ) return "fuschia"; else if (backgroundcolor == 8 ) return "green"; else if (backgroundcolor == 9 ) return "purple"; else if (backgroundcolor == 10 ) return "gray"; else if (backgroundcolor == 11 ) return "yellow"; else if (backgroundcolor == 12 ) return "aqua"; else if (backgroundcolor == 13 ) return "black"; else if (backgroundcolor == 14 ) return "white"; else if (backgroundcolor == 15 ) return "silver"; } // --> </SCRIPT> <!------------------------- 여기까지 ----------------------------------> </HEAD> <BODY> <!---- [2단계] 아래의 코드를 원하는 위치에 복사 해 넣으세요 --------------------> <CENTER> <FORM> <input type="button" value="랜덤 배경색상 보기" onClick="randombackground();this.blur()"> </FORM> </CENTER> <!------------------------- 여기까지 ---------------------------------->
기본
2013.09.09 22:09
랜덤 배경 스크립트
조회 수 4772 추천 수 0 댓글 0
미리보기 | http://linfree.com/javaboard/40.html |
---|