묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
디지털 시계, 버튼효과 소스중 틀린점이 뭔지..ㅠ_ㅠ
2003.09.08 12:19
:::::::::::::::::::::::::::::::::: 디지털 시계 만드는 소스구요 ::::::::::::::::::::::::::::::::::
<html>
<head>
<title> SCRIPT 태그 내에 주석 사용하기 </title>
<script language = "javascript">
<!--
var timerid = null;
var timerrunning = false;
var id, pause=0, position=o;
function stopclock () {
if(timerrunning)
cleartimeout(timerid);
timerrunning = false;
}
function showtime () {
var now = new data () ;
var hours = now.gethours () ;
var minutes = now.getminutes () ;
var seconds = now.getseconds ();
var timevalue = "" + ((hours >12) ? hours -12 :hours);
timevalue += ((minutes < 10 ) ? ":0" : ":") + minutes;
timevalue += ((seconds < 10 ) ? ":0" : ":") + seconds;
timevalue += (hours >= 12) ? " P.M." : " A.M.";
document.clock.face.value = timevalue;
timerid = settimeout("showtime()" ,1000);
timerrunning = true;
}
function startclock () {
stopclock() ;
showtime() ;
}
//-->
</script>
</head>
<body onload="startclock()">
<center>
<h2> 디지털 시계 <br>
<form name="clock" >
<input type="text" name="face" size="13">
</center>
</body>
</html>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::: 버튼만들면 바탕색 변하는는 소스요 :::::::::::::::::::::::::::::
<html>
<head>
<title> 배경색상 바꾸기</title>
<script language = "javascript">
<!--
var origcolor = 'true'
function bgcolor () {
if (origcolor == 'true') {
document.bgcolor = "burlywood";
origcolor - 'flase';
} else {
document.bgcolor = "lightblue";
origcolor = 'true';
}
}
//->
</script>
</head>
<body>
<form name="change_bgcolor">
<input type="button" value="바탕색 바꾸기" onclick="bgcolor()">
</form>
</script>
</body>
</html>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
도대체 뭐가 안되는 건지..@.@;;
어떤 분이시든지 답변좀 부탁드립니다..
<html>
<head>
<title> SCRIPT 태그 내에 주석 사용하기 </title>
<script language = "javascript">
<!--
var timerid = null;
var timerrunning = false;
var id, pause=0, position=o;
function stopclock () {
if(timerrunning)
cleartimeout(timerid);
timerrunning = false;
}
function showtime () {
var now = new data () ;
var hours = now.gethours () ;
var minutes = now.getminutes () ;
var seconds = now.getseconds ();
var timevalue = "" + ((hours >12) ? hours -12 :hours);
timevalue += ((minutes < 10 ) ? ":0" : ":") + minutes;
timevalue += ((seconds < 10 ) ? ":0" : ":") + seconds;
timevalue += (hours >= 12) ? " P.M." : " A.M.";
document.clock.face.value = timevalue;
timerid = settimeout("showtime()" ,1000);
timerrunning = true;
}
function startclock () {
stopclock() ;
showtime() ;
}
//-->
</script>
</head>
<body onload="startclock()">
<center>
<h2> 디지털 시계 <br>
<form name="clock" >
<input type="text" name="face" size="13">
</center>
</body>
</html>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::: 버튼만들면 바탕색 변하는는 소스요 :::::::::::::::::::::::::::::
<html>
<head>
<title> 배경색상 바꾸기</title>
<script language = "javascript">
<!--
var origcolor = 'true'
function bgcolor () {
if (origcolor == 'true') {
document.bgcolor = "burlywood";
origcolor - 'flase';
} else {
document.bgcolor = "lightblue";
origcolor = 'true';
}
}
//->
</script>
</head>
<body>
<form name="change_bgcolor">
<input type="button" value="바탕색 바꾸기" onclick="bgcolor()">
</form>
</script>
</body>
</html>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
도대체 뭐가 안되는 건지..@.@;;
어떤 분이시든지 답변좀 부탁드립니다..
댓글 2
-
김소형
2003.09.08 17:46
bgcolor를 bgColor로 바꿔주세요. -
Chamran
2003.09.09 07:43
document.bgcolor <--자바는 대소문자 구별하거든요..위에분말대로하심이