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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5530 | 13년 전 | 529 | ||
| 5529 | 13년 전 | 729 | ||
| 5528 | 13년 전 | 708 | ||
| 5527 | 13년 전 | 1018 | ||
| 5526 | 13년 전 | 1047 | ||
| 5525 | 13년 전 | 1811 | ||
| 5524 | 13년 전 | 686 | ||
| 5523 |
high8sky
|
13년 전 | 736 | |
| 5522 | 13년 전 | 3137 | ||
| 5521 | 13년 전 | 869 | ||
| 5520 |
즐거운상상을
|
13년 전 | 1127 | |
| 5519 | 13년 전 | 1502 | ||
| 5518 | 13년 전 | 953 | ||
| 5517 | 13년 전 | 1942 | ||
| 5516 | 13년 전 | 659 | ||
| 5515 |
순천홈페이지
|
13년 전 | 2809 | |
| 5514 | 13년 전 | 1164 | ||
| 5513 |
수야3019
|
13년 전 | 1495 | |
| 5512 | 13년 전 | 901 | ||
| 5511 | 13년 전 | 1057 | ||
| 5510 |
|
13년 전 | 1416 | |
| 5509 |
|
13년 전 | 1097 | |
| 5508 | 13년 전 | 1654 | ||
| 5507 | 13년 전 | 1540 | ||
| 5506 | 13년 전 | 704 | ||
| 5505 | 13년 전 | 2780 | ||
| 5504 |
물끄덩미끄덩
|
13년 전 | 946 | |
| 5503 |
후라보노보노
|
13년 전 | 1966 | |
| 5502 | 13년 전 | 862 | ||
| 5501 | 13년 전 | 1933 | ||
| 5500 | 13년 전 | 1809 | ||
| 5499 | 13년 전 | 1798 | ||
| 5498 | 13년 전 | 756 | ||
| 5497 |
레인보우1492
|
13년 전 | 1332 | |
| 5496 | 13년 전 | 1063 | ||
| 5495 |
jdjjun00
|
13년 전 | 2030 | |
| 5494 | 13년 전 | 892 | ||
| 5493 | 13년 전 | 983 | ||
| 5492 | 13년 전 | 1233 | ||
| 5491 | 13년 전 | 1081 | ||
| 5490 | 13년 전 | 874 | ||
| 5489 |
빨간망사챠챠
|
13년 전 | 2278 | |
| 5488 |
나태한개미
|
13년 전 | 1060 | |
| 5487 |
나태한개미
|
13년 전 | 1019 | |
| 5486 |
나태한개미
|
13년 전 | 2111 | |
| 5485 | 13년 전 | 1798 | ||
| 5484 | 13년 전 | 6530 | ||
| 5483 | 13년 전 | 1427 | ||
| 5482 |
Raincommunication
|
13년 전 | 762 | |
| 5481 |
|
13년 전 | 576 | |
| 5480 |
|
13년 전 | 989 | |
| 5479 | 13년 전 | 1034 | ||
| 5478 |
|
13년 전 | 879 | |
| 5477 | 13년 전 | 665 | ||
| 5476 | 13년 전 | 1111 | ||
| 5475 | 13년 전 | 1422 | ||
| 5474 | 13년 전 | 816 | ||
| 5473 | 13년 전 | 638 | ||
| 5472 | 13년 전 | 1119 | ||
| 5471 | 13년 전 | 1592 | ||
| 5470 | 13년 전 | 941 | ||
| 5469 |
BackToHeaven
|
13년 전 | 2217 | |
| 5468 |
멀티트리플
|
13년 전 | 1098 | |
| 5467 | 13년 전 | 725 | ||
| 5466 | 13년 전 | 1301 | ||
| 5465 | 13년 전 | 1403 | ||
| 5464 | 13년 전 | 1481 | ||
| 5463 | 13년 전 | 670 | ||
| 5462 | 13년 전 | 1399 | ||
| 5461 | 13년 전 | 1015 | ||
| 5460 | 13년 전 | 2539 | ||
| 5459 | 13년 전 | 1045 | ||
| 5458 |
프로프리랜서
|
13년 전 | 934 | |
| 5457 | 13년 전 | 794 | ||
| 5456 |
PHPㅡASP프로그래머
|
13년 전 | 1315 | |
| 5455 |
뭐먹고살지ㅠ
|
13년 전 | 841 | |
| 5454 | 13년 전 | 1594 | ||
| 5453 |
프리랜서클럽
|
13년 전 | 1184 | |
| 5452 | 13년 전 | 825 | ||
| 5451 | 13년 전 | 779 | ||
| 5450 | 13년 전 | 7288 | ||
| 5449 |
PHPㅡASP프로그래머
|
13년 전 | 826 | |
| 5448 |
DBDBDB
|
13년 전 | 664 | |
| 5447 | 13년 전 | 1931 | ||
| 5446 |
헬프데스크
|
13년 전 | 1794 | |
| 5445 | 13년 전 | 946 | ||
| 5444 |
Werbershinta
|
13년 전 | 662 | |
| 5443 | 13년 전 | 1329 | ||
| 5442 | 13년 전 | 1049 | ||
| 5441 | 13년 전 | 1163 | ||
| 5440 | 13년 전 | 3152 | ||
| 5439 | 13년 전 | 819 | ||
| 5438 |
ddokkani
|
13년 전 | 754 | |
| 5437 | 13년 전 | 2619 | ||
| 5436 | 13년 전 | 1014 | ||
| 5435 |
PHPㅡASP프로그래머
|
13년 전 | 831 | |
| 5434 |
돗단배123
|
13년 전 | 1608 | |
| 5433 | 13년 전 | 1763 | ||
| 5432 |
|
13년 전 | 917 | |
| 5431 | 13년 전 | 757 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기