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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8030 | 9년 전 | 353 | ||
| 8029 | 9년 전 | 285 | ||
| 8028 | 9년 전 | 254 | ||
| 8027 | 9년 전 | 264 | ||
| 8026 | 9년 전 | 309 | ||
| 8025 | 9년 전 | 367 | ||
| 8024 | 9년 전 | 333 | ||
| 8023 | 9년 전 | 380 | ||
| 8022 | 9년 전 | 310 | ||
| 8021 | 9년 전 | 313 | ||
| 8020 | 9년 전 | 307 | ||
| 8019 | 9년 전 | 329 | ||
| 8018 | 9년 전 | 435 | ||
| 8017 | 9년 전 | 528 | ||
| 8016 | 9년 전 | 317 | ||
| 8015 | 9년 전 | 381 | ||
| 8014 | 9년 전 | 314 | ||
| 8013 | 9년 전 | 226 | ||
| 8012 | 9년 전 | 236 | ||
| 8011 | 9년 전 | 435 | ||
| 8010 | 9년 전 | 288 | ||
| 8009 | 9년 전 | 273 | ||
| 8008 | 9년 전 | 276 | ||
| 8007 | 9년 전 | 419 | ||
| 8006 | 9년 전 | 454 | ||
| 8005 |
|
9년 전 | 956 | |
| 8004 | 9년 전 | 339 | ||
| 8003 | 9년 전 | 411 | ||
| 8002 | 9년 전 | 316 | ||
| 8001 |
|
9년 전 | 659 | |
| 8000 | 9년 전 | 403 | ||
| 7999 | 9년 전 | 363 | ||
| 7998 | 9년 전 | 416 | ||
| 7997 | 9년 전 | 303 | ||
| 7996 | 9년 전 | 529 | ||
| 7995 | 9년 전 | 443 | ||
| 7994 | 9년 전 | 288 | ||
| 7993 | 9년 전 | 362 | ||
| 7992 | 9년 전 | 499 | ||
| 7991 | 9년 전 | 239 | ||
| 7990 | 9년 전 | 261 | ||
| 7989 | 9년 전 | 293 | ||
| 7988 | 9년 전 | 717 | ||
| 7987 | 9년 전 | 412 | ||
| 7986 | 9년 전 | 401 | ||
| 7985 | 9년 전 | 500 | ||
| 7984 | 9년 전 | 421 | ||
| 7983 | 9년 전 | 642 | ||
| 7982 | 9년 전 | 503 | ||
| 7981 | 9년 전 | 450 | ||
| 7980 | 9년 전 | 476 | ||
| 7979 | 9년 전 | 450 | ||
| 7978 | 9년 전 | 431 | ||
| 7977 | 9년 전 | 371 | ||
| 7976 | 9년 전 | 840 | ||
| 7975 | 9년 전 | 353 | ||
| 7974 | 9년 전 | 383 | ||
| 7973 | 9년 전 | 584 | ||
| 7972 | 9년 전 | 370 | ||
| 7971 | 9년 전 | 445 | ||
| 7970 | 9년 전 | 285 | ||
| 7969 | 9년 전 | 532 | ||
| 7968 | 9년 전 | 370 | ||
| 7967 | 9년 전 | 355 | ||
| 7966 | 9년 전 | 359 | ||
| 7965 |
|
9년 전 | 1006 | |
| 7964 | 9년 전 | 390 | ||
| 7963 | 9년 전 | 378 | ||
| 7962 | 9년 전 | 362 | ||
| 7961 |
전갈자리남자
|
9년 전 | 499 | |
| 7960 | 9년 전 | 953 | ||
| 7959 | 9년 전 | 544 | ||
| 7958 | 9년 전 | 399 | ||
| 7957 | 9년 전 | 360 | ||
| 7956 | 9년 전 | 364 | ||
| 7955 | 9년 전 | 435 | ||
| 7954 | 9년 전 | 359 | ||
| 7953 | 9년 전 | 417 | ||
| 7952 | 9년 전 | 343 | ||
| 7951 | 9년 전 | 489 | ||
| 7950 | 9년 전 | 375 | ||
| 7949 | 9년 전 | 381 | ||
| 7948 | 9년 전 | 316 | ||
| 7947 | 9년 전 | 921 | ||
| 7946 | 9년 전 | 411 | ||
| 7945 | 9년 전 | 382 | ||
| 7944 | 9년 전 | 389 | ||
| 7943 | 9년 전 | 360 | ||
| 7942 | 9년 전 | 398 | ||
| 7941 | 9년 전 | 379 | ||
| 7940 | 9년 전 | 870 | ||
| 7939 | 9년 전 | 325 | ||
| 7938 | 9년 전 | 362 | ||
| 7937 | 9년 전 | 265 | ||
| 7936 | 9년 전 | 870 | ||
| 7935 | 9년 전 | 427 | ||
| 7934 | 9년 전 | 396 | ||
| 7933 | 9년 전 | 477 | ||
| 7932 | 9년 전 | 454 | ||
| 7931 | 9년 전 | 510 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기