1 개요
- HTML 프레임셋 영역 크기 조정
- HTML 메뉴 프레임 구조의 변형판
- 버튼으로 메뉴 영역의 너비를 조정한다(토글)
- 단 수동으로 메뉴 영역의 너비를 조정한 후에는 자바스크립트에서 제어할 수 없게 되기 때문에 NORESIZE 옵션을 준다.
- 예제: http://jmnote.com/js/menuframe2/index.php
2 index.php
html
Copy
<!DOCTYPE html>
<meta charset="utf-8" />
<title>웹사이트 제목</title>
<frameset id='main_frameset' cols="200,*" noresize>
<frame name="menu" id="menu" src="menu.php">
<frame name="main" id="main" src="home.php">
</frameset>
<input type='button' onclick='resize_toggle()' value='↔'>
<a href="home.php" target="main">HOME</a>
<a href="page1.php" target="main">1페이지</a>
<a href="page2.php" target="main">2페이지</a>
<script> function resize_toggle() {
var obj = parent.document.getElementById('main_frameset'); if(obj.cols == '50,*')obj.cols='180,*'; else obj.cols='50,*';
} </script> </source>
4 main.php
html
Copy
메뉴