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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 92 | ||
| 8229 | 9년 전 | 94 | ||
| 8228 |
커네드커네드
|
9년 전 | 138 | |
| 8227 | 9년 전 | 159 | ||
| 8226 | 9년 전 | 186 | ||
| 8225 | 9년 전 | 174 | ||
| 8224 | 9년 전 | 166 | ||
| 8223 | 9년 전 | 136 | ||
| 8222 |
|
9년 전 | 208 | |
| 8221 | 9년 전 | 119 | ||
| 8220 | 9년 전 | 133 | ||
| 8219 | 9년 전 | 118 | ||
| 8218 | 9년 전 | 165 | ||
| 8217 |
star3840
|
9년 전 | 134 | |
| 8216 | 9년 전 | 184 | ||
| 8215 | 9년 전 | 139 | ||
| 8214 | 9년 전 | 247 | ||
| 8213 | 9년 전 | 190 | ||
| 8212 | 9년 전 | 108 | ||
| 8211 | 9년 전 | 276 | ||
| 8210 | 9년 전 | 273 | ||
| 8209 | 9년 전 | 360 | ||
| 8208 | 9년 전 | 249 | ||
| 8207 | 9년 전 | 246 | ||
| 8206 |
|
9년 전 | 212 | |
| 8205 | 9년 전 | 198 | ||
| 8204 | 9년 전 | 155 | ||
| 8203 | 9년 전 | 253 | ||
| 8202 | 9년 전 | 166 | ||
| 8201 | 9년 전 | 201 | ||
| 8200 | 9년 전 | 191 | ||
| 8199 | 9년 전 | 237 | ||
| 8198 | 9년 전 | 202 | ||
| 8197 | 9년 전 | 186 | ||
| 8196 | 9년 전 | 577 | ||
| 8195 | 9년 전 | 182 | ||
| 8194 | 9년 전 | 308 | ||
| 8193 | 9년 전 | 186 | ||
| 8192 | 9년 전 | 220 | ||
| 8191 | 9년 전 | 168 | ||
| 8190 | 9년 전 | 164 | ||
| 8189 | 9년 전 | 225 | ||
| 8188 | 9년 전 | 154 | ||
| 8187 | 9년 전 | 170 | ||
| 8186 | 9년 전 | 164 | ||
| 8185 | 9년 전 | 341 | ||
| 8184 | 9년 전 | 129 | ||
| 8183 | 9년 전 | 341 | ||
| 8182 | 9년 전 | 197 | ||
| 8181 | 9년 전 | 157 | ||
| 8180 | 9년 전 | 728 | ||
| 8179 | 9년 전 | 509 | ||
| 8178 | 9년 전 | 339 | ||
| 8177 |
kiplayer
|
9년 전 | 350 | |
| 8176 | 9년 전 | 386 | ||
| 8175 | 9년 전 | 252 | ||
| 8174 | 9년 전 | 271 | ||
| 8173 | 9년 전 | 364 | ||
| 8172 | 9년 전 | 229 | ||
| 8171 | 9년 전 | 204 | ||
| 8170 | 9년 전 | 317 | ||
| 8169 |
커네드커네드
|
9년 전 | 281 | |
| 8168 | 9년 전 | 350 | ||
| 8167 | 9년 전 | 341 | ||
| 8166 | 9년 전 | 262 | ||
| 8165 | 9년 전 | 191 | ||
| 8164 | 9년 전 | 327 | ||
| 8163 | 9년 전 | 309 | ||
| 8162 | 9년 전 | 330 | ||
| 8161 | 9년 전 | 319 | ||
| 8160 |
|
9년 전 | 516 | |
| 8159 | 9년 전 | 455 | ||
| 8158 | 9년 전 | 276 | ||
| 8157 | 9년 전 | 401 | ||
| 8156 | 9년 전 | 289 | ||
| 8155 | 9년 전 | 279 | ||
| 8154 |
00년생용띠
|
9년 전 | 623 | |
| 8153 | 9년 전 | 259 | ||
| 8152 |
|
9년 전 | 435 | |
| 8151 | 9년 전 | 441 | ||
| 8150 | 9년 전 | 533 | ||
| 8149 |
Jangfolk
|
9년 전 | 371 | |
| 8148 | 9년 전 | 195 | ||
| 8147 | 9년 전 | 408 | ||
| 8146 | 9년 전 | 473 | ||
| 8145 | 9년 전 | 426 | ||
| 8144 | 9년 전 | 387 | ||
| 8143 | 9년 전 | 221 | ||
| 8142 | 9년 전 | 458 | ||
| 8141 | 9년 전 | 407 | ||
| 8140 | 9년 전 | 952 | ||
| 8139 | 9년 전 | 294 | ||
| 8138 |
전갈자리남자
|
9년 전 | 412 | |
| 8137 | 9년 전 | 427 | ||
| 8136 | 9년 전 | 773 | ||
| 8135 |
|
9년 전 | 817 | |
| 8134 |
PlayPixel
|
9년 전 | 542 | |
| 8133 |
|
9년 전 | 464 | |
| 8132 | 9년 전 | 485 | ||
| 8131 | 9년 전 | 833 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기