1.html 파일
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<FRAMESET cols="100,*" id="frmset" frameborder="1">
<FRAME src="2.html">
<FRAME src="3.html">
</FRAMESET>
<body>
</body>
</html>
2.html 파일
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV='Content-Type' CONTENT='TEXT/HTML; Charset=EUC-KR'>
<TITLE></TITLE>
<link rel="stylesheet" type="text/css" href="">
<script language="javascript">
function frmset(code)
{
var data = parent.frmset.cols;
start_p = parent.frmset.cols.indexOf(",");
end_p = parent.frmset.cols.length;
/*
var data1 = parseInt(parent.frmset.cols.substring(0, start_p));
var data2 = parseInt(parent.frmset.cols.substring(start_p+1, end_p));
*/
if (code == "+")
{
var data1 = parseInt(parent.frmset.cols.substring(0, start_p))+10;
parent.frmset.cols = data1+", *";
}
else if (code == "-")
{
var data1 = parseInt(parent.frmset.cols.substring(0, start_p))-10;
parent.frmset.cols = data1+", *";
}
}
</script>
</HEAD>
<BODY>
<A href="#" onclick="frmset('+')">변해랏 +</A><br>
<A href="#" onclick="frmset('-')">변해랏 -</A>
</BODY>
</HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<FRAMESET cols="100,*" id="frmset" frameborder="1">
<FRAME src="2.html">
<FRAME src="3.html">
</FRAMESET>
<body>
</body>
</html>
2.html 파일
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV='Content-Type' CONTENT='TEXT/HTML; Charset=EUC-KR'>
<TITLE></TITLE>
<link rel="stylesheet" type="text/css" href="">
<script language="javascript">
function frmset(code)
{
var data = parent.frmset.cols;
start_p = parent.frmset.cols.indexOf(",");
end_p = parent.frmset.cols.length;
/*
var data1 = parseInt(parent.frmset.cols.substring(0, start_p));
var data2 = parseInt(parent.frmset.cols.substring(start_p+1, end_p));
*/
if (code == "+")
{
var data1 = parseInt(parent.frmset.cols.substring(0, start_p))+10;
parent.frmset.cols = data1+", *";
}
else if (code == "-")
{
var data1 = parseInt(parent.frmset.cols.substring(0, start_p))-10;
parent.frmset.cols = data1+", *";
}
}
</script>
</HEAD>
<BODY>
<A href="#" onclick="frmset('+')">변해랏 +</A><br>
<A href="#" onclick="frmset('-')">변해랏 -</A>
</BODY>
</HTML>
반응형
'홈페이지 제작 > JavaScript' 카테고리의 다른 글
체크박스, 라디오버튼 선택여부 알아보기 (0) | 2004.11.11 |
---|---|
천단위마다 콤마 자동으로 찍어주기 (0) | 2004.09.08 |
숫자만 입력받기 (0) | 2004.09.04 |
중복없는 무작위 숫자만들기 (로또복권) (0) | 2004.08.11 |
숫자관련 함수 (0) | 2004.08.11 |