index 파일입니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title></title>
<link type="text/css" rel="stylesheet" href="type/common.css" />
<script type="text/javascript" src="type/jquery-1.7.2.min.js"></script>
</head>
<body>
<div id="header">
<h1><a href="/"><img src="image/logo.jpg" /></a></h1>
<div class="navigation">
<ul class="topnav">
<li><a href="#">회사소개</a>
<ul class="subnav">
<li><a href="#">Sub Nav Link</a></li>
<li><a href="#">Sub Nav Link</a></li>
</ul>
</li>
<li><a href="#">사업개요</a>
<ul class="subnav">
<li><a href="#">Sub Nav Link</a></li>
<li><a href="#">Sub Nav Link</a></li>
</ul>
</li>
</ul>
</div>
<script>
$(document).ready(function(){
$("ul.subnav").parent().append("<span></span>");
$("ul.topnav li").mouseover(function() {
$(this).parent().find("ul.subnav").slideDown('fast').show();
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow');
});
}).hover(function() {
$(this).addClass("subhover");
}, function(){
$(this).removeClass("subhover");
});
});
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title></title>
<link type="text/css" rel="stylesheet" href="type/common.css" />
<script type="text/javascript" src="type/jquery-1.7.2.min.js"></script>
</head>
<body>
<div id="header">
<h1><a href="/"><img src="image/logo.jpg" /></a></h1>
<div class="navigation">
<ul class="topnav">
<li><a href="#">회사소개</a>
<ul class="subnav">
<li><a href="#">Sub Nav Link</a></li>
<li><a href="#">Sub Nav Link</a></li>
</ul>
</li>
<li><a href="#">사업개요</a>
<ul class="subnav">
<li><a href="#">Sub Nav Link</a></li>
<li><a href="#">Sub Nav Link</a></li>
</ul>
</li>
</ul>
</div>
<script>
$(document).ready(function(){
$("ul.subnav").parent().append("<span></span>");
$("ul.topnav li").mouseover(function() {
$(this).parent().find("ul.subnav").slideDown('fast').show();
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow');
});
}).hover(function() {
$(this).addClass("subhover");
}, function(){
$(this).removeClass("subhover");
});
});
</script>
</body>
</html>
</html>
css파일입니다.
/*navigation*/
ul.topnav {padding:0 20px; margin:0; width:920px; background:#222; font-size:1.2em; background:url() repeat-x;}
ul.topnav {padding:0 20px; margin:0; width:920px; background:#222; font-size:1.2em; background:url() repeat-x;}
ul.topnav li {margin:0; padding:0 15px 0 0; position:relative;}
ul.topnav li a {padding:10px 5px; color:#29f483; display:block; text-decoration:none; float:left;}
ul.topnav li a:hover {background:url() no-repeat center top;}
ul.topnav li a {padding:10px 5px; color:#29f483; display:block; text-decoration:none; float:left;}
ul.topnav li a:hover {background:url() no-repeat center top;}
/*ul.topnav li span {width:17px; height:35px; float:left; background:url(1.jpg) no-repeat center top;}*/
/*ul.topnav li span.subhover {background-position:center bottombottom; cursor:pointer;}*/
ul.topnav li ul.subnav {position:absolute; left:0; top:35px; background:#333; margin:0; padding:0; display:none; float:left; width:170px; border:1px solid #111;}
ul.topnav li ul.subnav li{margin:0; padding:0; border-top:1px solid #252525; border-bottom:1px solid #444; clear:both; width:170px;}
html ul.topnav li ul.subnav li a {float:left; width:145px; background:#333 url() no-repeat 10px center; padding-left:20px;} html ul.topnav li ul.subnav li a:hover {background:#222 url() no-repeat 10px center;}
ul.topnav li ul.subnav {position:absolute; left:0; top:35px; background:#333; margin:0; padding:0; display:none; float:left; width:170px; border:1px solid #111;}
ul.topnav li ul.subnav li{margin:0; padding:0; border-top:1px solid #252525; border-bottom:1px solid #444; clear:both; width:170px;}
html ul.topnav li ul.subnav li a {float:left; width:145px; background:#333 url() no-repeat 10px center; padding-left:20px;} html ul.topnav li ul.subnav li a:hover {background:#222 url() no-repeat 10px center;}
원래 소스는 메뉴 옆 빈공간을 만들어 클릭시에 메뉴가 드롭다운 되게 하는 구조입니다.
제가 수정한 부분은 bold처리 된 부분이며, 위 소스대로 수정 후 실행시 아시다시피 모든 메뉴가 한번에 드롭다운 됩니다.
메뉴에 마우스 오버를 했을 시 마우스오버 된 메뉴의 서브메뉴만 노출되게 하고 싶습니다.
조언부탁드립니다.
html의 script 수정부분은 ul.topnav li span 부분을 ul.topnav li 로 수정하였으며, css는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6130 |
gender
|
12년 전 | 1091 | |
| 6129 | 12년 전 | 1321 | ||
| 6128 |
|
12년 전 | 3461 | |
| 6127 | 12년 전 | 695 | ||
| 6126 |
|
12년 전 | 2208 | |
| 6125 |
|
12년 전 | 4884 | |
| 6124 | 12년 전 | 660 | ||
| 6123 | 12년 전 | 3840 | ||
| 6122 | 12년 전 | 1016 | ||
| 6121 | 12년 전 | 3750 | ||
| 6120 | 12년 전 | 908 | ||
| 6119 | 12년 전 | 1769 | ||
| 6118 | 12년 전 | 929 | ||
| 6117 | 12년 전 | 2147 | ||
| 6116 | 12년 전 | 7942 | ||
| 6115 | 12년 전 | 1918 | ||
| 6114 |
|
12년 전 | 1705 | |
| 6113 | 12년 전 | 1522 | ||
| 6112 | 12년 전 | 593 | ||
| 6111 | 12년 전 | 2110 | ||
| 6110 | 12년 전 | 1849 | ||
| 6109 | 12년 전 | 638 | ||
| 6108 | 12년 전 | 1197 | ||
| 6107 | 12년 전 | 619 | ||
| 6106 | 12년 전 | 904 | ||
| 6105 | 12년 전 | 1189 | ||
| 6104 | 12년 전 | 3595 | ||
| 6103 | 12년 전 | 2120 | ||
| 6102 | 12년 전 | 2311 | ||
| 6101 | 12년 전 | 3674 | ||
| 6100 | 12년 전 | 3481 | ||
| 6099 | 12년 전 | 3150 | ||
| 6098 | 12년 전 | 4023 | ||
| 6097 | 12년 전 | 1012 | ||
| 6096 | 12년 전 | 5979 | ||
| 6095 | 12년 전 | 1369 | ||
| 6094 | 12년 전 | 1224 | ||
| 6093 | 12년 전 | 3406 | ||
| 6092 | 12년 전 | 3053 | ||
| 6091 | 12년 전 | 5192 | ||
| 6090 | 12년 전 | 2701 | ||
| 6089 | 12년 전 | 3326 | ||
| 6088 | 12년 전 | 1014 | ||
| 6087 | 12년 전 | 846 | ||
| 6086 | 12년 전 | 2017 | ||
| 6085 |
|
12년 전 | 806 | |
| 6084 |
웹디자인되고파
|
12년 전 | 2216 | |
| 6083 | 12년 전 | 1506 | ||
| 6082 | 12년 전 | 1111 | ||
| 6081 | 12년 전 | 2099 | ||
| 6080 |
Stiven
|
12년 전 | 2312 | |
| 6079 |
프로프리랜서
|
12년 전 | 1317 | |
| 6078 |
프로프리랜서
|
12년 전 | 786 | |
| 6077 |
프로프리랜서
|
12년 전 | 1341 | |
| 6076 |
프로프리랜서
|
12년 전 | 829 | |
| 6075 |
프로프리랜서
|
12년 전 | 1220 | |
| 6074 | 12년 전 | 3854 | ||
| 6073 | 12년 전 | 3949 | ||
| 6072 | 12년 전 | 1373 | ||
| 6071 | 12년 전 | 6990 | ||
| 6070 | 12년 전 | 7574 | ||
| 6069 | 12년 전 | 2319 | ||
| 6068 | 12년 전 | 3866 | ||
| 6067 |
smwkd
|
12년 전 | 632 | |
| 6066 | 12년 전 | 3656 | ||
| 6065 | 12년 전 | 3486 | ||
| 6064 | 12년 전 | 2720 | ||
| 6063 | 12년 전 | 2840 | ||
| 6062 | 12년 전 | 2369 | ||
| 6061 | 12년 전 | 2276 | ||
| 6060 | 12년 전 | 5182 | ||
| 6059 | 12년 전 | 2812 | ||
| 6058 | 12년 전 | 3133 | ||
| 6057 | 12년 전 | 2261 | ||
| 6056 | 12년 전 | 6839 | ||
| 6055 | 12년 전 | 2581 | ||
| 6054 | 12년 전 | 3433 | ||
| 6053 | 12년 전 | 2324 | ||
| 6052 | 12년 전 | 4818 | ||
| 6051 | 12년 전 | 3711 | ||
| 6050 | 12년 전 | 2554 | ||
| 6049 | 12년 전 | 2244 | ||
| 6048 |
|
12년 전 | 1295 | |
| 6047 | 12년 전 | 3438 | ||
| 6046 | 12년 전 | 4094 | ||
| 6045 | 12년 전 | 3454 | ||
| 6044 | 12년 전 | 5331 | ||
| 6043 | 12년 전 | 1650 | ||
| 6042 | 12년 전 | 1281 | ||
| 6041 | 12년 전 | 5163 | ||
| 6040 | 12년 전 | 937 | ||
| 6039 | 12년 전 | 3409 | ||
| 6038 | 12년 전 | 3411 | ||
| 6037 | 12년 전 | 2992 | ||
| 6036 | 12년 전 | 3341 | ||
| 6035 | 12년 전 | 2867 | ||
| 6034 | 12년 전 | 2844 | ||
| 6033 | 12년 전 | 2866 | ||
| 6032 | 12년 전 | 2854 | ||
| 6031 | 12년 전 | 2879 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기