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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5630 | 13년 전 | 1072 | ||
| 5629 | 13년 전 | 2713 | ||
| 5628 | 13년 전 | 1288 | ||
| 5627 | 13년 전 | 1665 | ||
| 5626 | 13년 전 | 1294 | ||
| 5625 | 13년 전 | 1949 | ||
| 5624 | 13년 전 | 1367 | ||
| 5623 | 13년 전 | 951 | ||
| 5622 | 13년 전 | 426 | ||
| 5621 | 13년 전 | 13315 | ||
| 5620 | 13년 전 | 1194 | ||
| 5619 | 13년 전 | 3339 | ||
| 5618 | 13년 전 | 977 | ||
| 5617 | 13년 전 | 428 | ||
| 5616 | 13년 전 | 602 | ||
| 5615 |
Preware
|
13년 전 | 424 | |
| 5614 | 13년 전 | 555 | ||
| 5613 |
AMDbest
|
13년 전 | 4343 | |
| 5612 |
AMDbest
|
13년 전 | 6167 | |
| 5611 | 13년 전 | 880 | ||
| 5610 |
AMDbest
|
13년 전 | 4668 | |
| 5609 | 13년 전 | 970 | ||
| 5608 |
|
13년 전 | 487 | |
| 5607 | 13년 전 | 656 | ||
| 5606 | 13년 전 | 473 | ||
| 5605 | 13년 전 | 369 | ||
| 5604 | 13년 전 | 609 | ||
| 5603 |
갑수엔터테인먼트
|
13년 전 | 769 | |
| 5602 | 13년 전 | 428 | ||
| 5601 | 13년 전 | 511 | ||
| 5600 | 13년 전 | 935 | ||
| 5599 | 13년 전 | 7470 | ||
| 5598 |
PHPㅡASP프로그래머
|
13년 전 | 2700 | |
| 5597 | 13년 전 | 404 | ||
| 5596 |
hoinV
|
13년 전 | 995 | |
| 5595 | 13년 전 | 922 | ||
| 5594 | 13년 전 | 1068 | ||
| 5593 | 13년 전 | 4943 | ||
| 5592 |
|
13년 전 | 390 | |
| 5591 | 13년 전 | 894 | ||
| 5590 |
PHPㅡASP프로그래머
|
13년 전 | 2309 | |
| 5589 | 13년 전 | 1943 | ||
| 5588 |
바다로가자
|
13년 전 | 1637 | |
| 5587 |
PHPㅡASP프로그래머
|
13년 전 | 1827 | |
| 5586 | 13년 전 | 2748 | ||
| 5585 | 13년 전 | 399 | ||
| 5584 | 13년 전 | 1877 | ||
| 5583 | 13년 전 | 1307 | ||
| 5582 |
바다로가자
|
13년 전 | 3098 | |
| 5581 |
|
13년 전 | 3114 | |
| 5580 | 13년 전 | 922 | ||
| 5579 |
하하369
|
13년 전 | 3978 | |
| 5578 | 13년 전 | 1064 | ||
| 5577 | 13년 전 | 1236 | ||
| 5576 | 13년 전 | 1646 | ||
| 5575 |
가위바위보
|
13년 전 | 1597 | |
| 5574 |
danielle
|
13년 전 | 706 | |
| 5573 |
|
13년 전 | 861 | |
| 5572 | 13년 전 | 2779 | ||
| 5571 | 13년 전 | 837 | ||
| 5570 | 13년 전 | 1424 | ||
| 5569 |
|
13년 전 | 2135 | |
| 5568 | 13년 전 | 1960 | ||
| 5567 | 13년 전 | 679 | ||
| 5566 |
|
13년 전 | 1312 | |
| 5565 | 13년 전 | 3672 | ||
| 5564 | 13년 전 | 921 | ||
| 5563 | 13년 전 | 1374 | ||
| 5562 | 13년 전 | 874 | ||
| 5561 | 13년 전 | 1045 | ||
| 5560 |
PHPㅡASP프로그래머
|
13년 전 | 1534 | |
| 5559 | 13년 전 | 634 | ||
| 5558 |
there007
|
13년 전 | 1553 | |
| 5557 | 13년 전 | 1187 | ||
| 5556 |
후라보노보노
|
13년 전 | 744 | |
| 5555 | 13년 전 | 9134 | ||
| 5554 | 13년 전 | 828 | ||
| 5553 |
가을이군요
|
13년 전 | 718 | |
| 5552 |
|
13년 전 | 792 | |
| 5551 | 13년 전 | 1510 | ||
| 5550 |
후라보노보노
|
13년 전 | 915 | |
| 5549 |
|
13년 전 | 1015 | |
| 5548 | 13년 전 | 678 | ||
| 5547 | 13년 전 | 526 | ||
| 5546 | 13년 전 | 4610 | ||
| 5545 | 13년 전 | 908 | ||
| 5544 | 13년 전 | 1024 | ||
| 5543 | 13년 전 | 760 | ||
| 5542 | 13년 전 | 6633 | ||
| 5541 | 13년 전 | 807 | ||
| 5540 | 13년 전 | 1137 | ||
| 5539 | 13년 전 | 1118 | ||
| 5538 | 13년 전 | 2832 | ||
| 5537 | 13년 전 | 811 | ||
| 5536 | 13년 전 | 2708 | ||
| 5535 |
|
13년 전 | 1214 | |
| 5534 | 13년 전 | 1772 | ||
| 5533 |
꿈꾸는인생
|
13년 전 | 1335 | |
| 5532 | 13년 전 | 1496 | ||
| 5531 | 13년 전 | 1712 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기