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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 645 | ||
| 7629 |
|
10년 전 | 2370 | |
| 7628 | 10년 전 | 782 | ||
| 7627 |
|
10년 전 | 1013 | |
| 7626 |
|
10년 전 | 1775 | |
| 7625 | 10년 전 | 685 | ||
| 7624 | 10년 전 | 701 | ||
| 7623 |
|
10년 전 | 3057 | |
| 7622 | 10년 전 | 713 | ||
| 7621 |
leeleeleelee
|
10년 전 | 576 | |
| 7620 | 10년 전 | 534 | ||
| 7619 | 10년 전 | 474 | ||
| 7618 | 10년 전 | 1006 | ||
| 7617 | 10년 전 | 718 | ||
| 7616 | 10년 전 | 625 | ||
| 7615 | 10년 전 | 720 | ||
| 7614 | 10년 전 | 1244 | ||
| 7613 |
|
10년 전 | 2073 | |
| 7612 | 10년 전 | 1129 | ||
| 7611 | 10년 전 | 1394 | ||
| 7610 |
|
10년 전 | 1894 | |
| 7609 |
|
10년 전 | 1319 | |
| 7608 |
mwdkim
|
10년 전 | 1113 | |
| 7607 |
|
10년 전 | 1041 | |
| 7606 |
mwdkim
|
10년 전 | 3909 | |
| 7605 | 10년 전 | 682 | ||
| 7604 | 10년 전 | 1018 | ||
| 7603 | 10년 전 | 1638 | ||
| 7602 |
|
10년 전 | 1056 | |
| 7601 |
AniNest
|
10년 전 | 2775 | |
| 7600 |
port443
|
10년 전 | 1014 | |
| 7599 | 10년 전 | 939 | ||
| 7598 | 10년 전 | 1006 | ||
| 7597 | 10년 전 | 4564 | ||
| 7596 |
SeungYeon
|
10년 전 | 882 | |
| 7595 |
untitled
|
10년 전 | 2408 | |
| 7594 |
프로그래머7
|
10년 전 | 1716 | |
| 7593 |
untitled
|
10년 전 | 2352 | |
| 7592 |
untitled
|
10년 전 | 1927 | |
| 7591 |
untitled
|
10년 전 | 2669 | |
| 7590 |
아리마2001
|
10년 전 | 845 | |
| 7589 | 10년 전 | 1096 | ||
| 7588 |
|
10년 전 | 2907 | |
| 7587 | 10년 전 | 1298 | ||
| 7586 | 10년 전 | 660 | ||
| 7585 | 10년 전 | 1674 | ||
| 7584 | 10년 전 | 1403 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1153 | |
| 7582 |
|
10년 전 | 1093 | |
| 7581 | 10년 전 | 1310 | ||
| 7580 | 10년 전 | 974 | ||
| 7579 |
|
10년 전 | 598 | |
| 7578 | 10년 전 | 1417 | ||
| 7577 |
|
10년 전 | 1865 | |
| 7576 | 10년 전 | 1379 | ||
| 7575 |
멋진남자임
|
10년 전 | 1456 | |
| 7574 | 10년 전 | 2103 | ||
| 7573 | 10년 전 | 3240 | ||
| 7572 | 10년 전 | 754 | ||
| 7571 |
|
10년 전 | 775 | |
| 7570 |
|
10년 전 | 1301 | |
| 7569 | 10년 전 | 1536 | ||
| 7568 |
this1mg
|
10년 전 | 1038 | |
| 7567 |
|
10년 전 | 751 | |
| 7566 | 10년 전 | 913 | ||
| 7565 |
Angel하늘
|
10년 전 | 983 | |
| 7564 |
seoldi
|
10년 전 | 1222 | |
| 7563 |
|
10년 전 | 1361 | |
| 7562 |
멋진남자임
|
10년 전 | 2069 | |
| 7561 | 10년 전 | 697 | ||
| 7560 |
leeleeleelee
|
10년 전 | 889 | |
| 7559 | 10년 전 | 5028 | ||
| 7558 |
RinaP
|
10년 전 | 766 | |
| 7557 |
|
10년 전 | 1228 | |
| 7556 | 10년 전 | 1183 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1650 | |
| 7554 | 10년 전 | 1087 | ||
| 7553 |
senseme
|
10년 전 | 1329 | |
| 7552 |
ehdltdoit
|
10년 전 | 1426 | |
| 7551 |
|
10년 전 | 1812 | |
| 7550 |
leeleeleelee
|
10년 전 | 1576 | |
| 7549 | 10년 전 | 2412 | ||
| 7548 | 10년 전 | 1830 | ||
| 7547 |
멋진남자임
|
10년 전 | 1952 | |
| 7546 | 10년 전 | 994 | ||
| 7545 |
ILMare1003
|
10년 전 | 1273 | |
| 7544 |
|
10년 전 | 1234 | |
| 7543 | 10년 전 | 878 | ||
| 7542 | 10년 전 | 649 | ||
| 7541 |
울라라라우
|
10년 전 | 857 | |
| 7540 | 10년 전 | 1593 | ||
| 7539 | 10년 전 | 920 | ||
| 7538 |
|
10년 전 | 1824 | |
| 7537 | 10년 전 | 3601 | ||
| 7536 |
Gaumi
|
10년 전 | 1398 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1255 | |
| 7534 |
senseme
|
10년 전 | 1197 | |
| 7533 | 10년 전 | 1182 | ||
| 7532 | 10년 전 | 849 | ||
| 7531 | 10년 전 | 2038 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기