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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5130 | 13년 전 | 753 | ||
| 5129 | 13년 전 | 1760 | ||
| 5128 | 13년 전 | 928 | ||
| 5127 | 13년 전 | 506 | ||
| 5126 | 13년 전 | 743 | ||
| 5125 | 13년 전 | 1351 | ||
| 5124 | 13년 전 | 822 | ||
| 5123 | 13년 전 | 456 | ||
| 5122 | 13년 전 | 994 | ||
| 5121 |
|
13년 전 | 1379 | |
| 5120 | 13년 전 | 498 | ||
| 5119 | 13년 전 | 474 | ||
| 5118 | 13년 전 | 402 | ||
| 5117 | 13년 전 | 714 | ||
| 5116 | 13년 전 | 450 | ||
| 5115 | 13년 전 | 905 | ||
| 5114 | 13년 전 | 937 | ||
| 5113 |
cookieyou
|
13년 전 | 1345 | |
| 5112 | 13년 전 | 529 | ||
| 5111 | 13년 전 | 821 | ||
| 5110 | 13년 전 | 4441 | ||
| 5109 | 13년 전 | 1061 | ||
| 5108 | 13년 전 | 406 | ||
| 5107 | 13년 전 | 478 | ||
| 5106 | 13년 전 | 634 | ||
| 5105 | 13년 전 | 1098 | ||
| 5104 | 13년 전 | 411 | ||
| 5103 |
프로프리랜서
|
13년 전 | 1342 | |
| 5102 | 13년 전 | 1584 | ||
| 5101 | 13년 전 | 457 | ||
| 5100 | 13년 전 | 367 | ||
| 5099 | 13년 전 | 519 | ||
| 5098 | 13년 전 | 2131 | ||
| 5097 | 13년 전 | 374 | ||
| 5096 | 13년 전 | 522 | ||
| 5095 | 13년 전 | 383 | ||
| 5094 | 13년 전 | 388 | ||
| 5093 | 13년 전 | 874 | ||
| 5092 | 13년 전 | 1056 | ||
| 5091 | 13년 전 | 411 | ||
| 5090 | 13년 전 | 510 | ||
| 5089 | 13년 전 | 950 | ||
| 5088 | 13년 전 | 402 | ||
| 5087 | 13년 전 | 1152 | ||
| 5086 | 13년 전 | 1478 | ||
| 5085 |
|
13년 전 | 3927 | |
| 5084 |
alexseo
|
13년 전 | 910 | |
| 5083 | 13년 전 | 1122 | ||
| 5082 | 13년 전 | 597 | ||
| 5081 | 13년 전 | 521 | ||
| 5080 | 13년 전 | 598 | ||
| 5079 | 13년 전 | 970 | ||
| 5078 | 13년 전 | 2183 | ||
| 5077 | 13년 전 | 668 | ||
| 5076 |
몰보는거야
|
13년 전 | 1689 | |
| 5075 |
|
13년 전 | 1764 | |
| 5074 | 13년 전 | 2005 | ||
| 5073 |
|
13년 전 | 763 | |
| 5072 |
프로프리랜서
|
13년 전 | 1039 | |
| 5071 |
프로프리랜서
|
13년 전 | 763 | |
| 5070 |
프로프리랜서
|
13년 전 | 876 | |
| 5069 |
뭐먹고살지ㅠ
|
13년 전 | 783 | |
| 5068 |
danielle
|
13년 전 | 643 | |
| 5067 | 13년 전 | 758 | ||
| 5066 | 13년 전 | 833 | ||
| 5065 | 13년 전 | 905 | ||
| 5064 | 13년 전 | 1715 | ||
| 5063 | 13년 전 | 432 | ||
| 5062 | 13년 전 | 804 | ||
| 5061 | 13년 전 | 577 | ||
| 5060 | 13년 전 | 379 | ||
| 5059 |
senseme
|
13년 전 | 837 | |
| 5058 | 13년 전 | 2845 | ||
| 5057 | 13년 전 | 1910 | ||
| 5056 | 13년 전 | 1481 | ||
| 5055 | 13년 전 | 438 | ||
| 5054 |
senseme
|
13년 전 | 1064 | |
| 5053 |
senseme
|
13년 전 | 1904 | |
| 5052 |
senseme
|
13년 전 | 1035 | |
| 5051 |
senseme
|
13년 전 | 1057 | |
| 5050 |
senseme
|
13년 전 | 796 | |
| 5049 |
senseme
|
13년 전 | 975 | |
| 5048 | 13년 전 | 1983 | ||
| 5047 | 13년 전 | 487 | ||
| 5046 |
우렁찬우렁이
|
13년 전 | 856 | |
| 5045 |
크라이스트
|
13년 전 | 2148 | |
| 5044 | 13년 전 | 962 | ||
| 5043 | 13년 전 | 528 | ||
| 5042 | 13년 전 | 969 | ||
| 5041 |
|
13년 전 | 804 | |
| 5040 |
스마일라니
|
13년 전 | 866 | |
| 5039 | 13년 전 | 1132 | ||
| 5038 | 13년 전 | 1922 | ||
| 5037 | 13년 전 | 1042 | ||
| 5036 |
cookieyou
|
13년 전 | 1397 | |
| 5035 | 13년 전 | 494 | ||
| 5034 | 13년 전 | 556 | ||
| 5033 | 13년 전 | 486 | ||
| 5032 | 13년 전 | 433 | ||
| 5031 | 13년 전 | 730 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기