자바스크립트
<html>
<head>
<title> </title>
</head>
<script language="JavaScript">
function clickHandler() {
var targetId, srcElement, targetElement;
srcElement = window.event.srcElement;
if (srcElement.className == "Outline") {
targetId = srcElement.id + "details";
targetElement = document.all(targetId);
if (targetElement.style.display == "none") {
targetElement.style.display = "";
} else {
targetElement.style.display = "none";
}
}
}
document.onclick = clickHandler;
</script>
<body LINK="#FF0000" VLINK="#4E4E4E">
<font id="Out1" class="Outline" style="cursor: hand; ">메인1</font> <br>
<div id="Out1details" style="display:None; position:relative; left:20;">
<a href="test.html">서브1-1</a><br>
<a href="test.html">서브1-2</a><br>
<a href="test.html">서브1-3</a><br>
<a href="test.html">서브1-4</a>
</div>
<font id="Out2" class="Outline" style="cursor: hand; ">메인2</font>
<div id="Out2details" style="display:None; position:relative; left:20;">
<a href="test.html">서브2-1</a><br>
<a href="test.html">서브2-2</a><br>
<a href="test.html">서브2-3</a><br>
<a href="test.html">서브2-4</a>
</div>
</body>
</html>
'Web Tech' 카테고리의 다른 글
무료 게시판 정리 (0) | 2007.03.21 |
---|---|
플래시 자동 활성화 시키기 (1) | 2006.11.30 |
클릭형 디스플레이 메뉴 (0) | 2006.11.27 |