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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 230 | 20년 전 | 2094 | ||
| 229 | 20년 전 | 3154 | ||
| 228 | 20년 전 | 3343 | ||
| 227 | 20년 전 | 2419 | ||
| 226 | 20년 전 | 5499 | ||
| 225 | 20년 전 | 2542 | ||
| 224 | 20년 전 | 2985 | ||
| 223 | 20년 전 | 4219 | ||
| 222 | 20년 전 | 2616 | ||
| 221 | 20년 전 | 2305 | ||
| 220 | 20년 전 | 3692 | ||
| 219 | 20년 전 | 2090 | ||
| 218 | 20년 전 | 3588 | ||
| 217 | 20년 전 | 2500 | ||
| 216 | 20년 전 | 2939 | ||
| 215 | 20년 전 | 2247 | ||
| 214 | 20년 전 | 3355 | ||
| 213 | 20년 전 | 2939 | ||
| 212 | 20년 전 | 3082 | ||
| 211 | 20년 전 | 2171 | ||
| 210 | 20년 전 | 1932 | ||
| 209 | 20년 전 | 2383 | ||
| 208 | 20년 전 | 2015 | ||
| 207 | 20년 전 | 1695 | ||
| 206 | 20년 전 | 1869 | ||
| 205 | 20년 전 | 3967 | ||
| 204 | 20년 전 | 1689 | ||
| 203 | 20년 전 | 2032 | ||
| 202 | 20년 전 | 2369 | ||
| 201 | 20년 전 | 1846 | ||
| 200 | 20년 전 | 2975 | ||
| 199 | 20년 전 | 2018 | ||
| 198 | 20년 전 | 2100 | ||
| 197 | 20년 전 | 3672 | ||
| 196 | 20년 전 | 3013 | ||
| 195 | 20년 전 | 2128 | ||
| 194 | 20년 전 | 10274 | ||
| 193 | 20년 전 | 2271 | ||
| 192 | 20년 전 | 1619 | ||
| 191 | 20년 전 | 2685 | ||
| 190 | 20년 전 | 2305 | ||
| 189 | 20년 전 | 1708 | ||
| 188 | 20년 전 | 1504 | ||
| 187 | 20년 전 | 1929 | ||
| 186 | 20년 전 | 1755 | ||
| 185 | 20년 전 | 1802 | ||
| 184 | 20년 전 | 2385 | ||
| 183 | 20년 전 | 1595 | ||
| 182 | 20년 전 | 1501 | ||
| 181 | 20년 전 | 1642 | ||
| 180 | 20년 전 | 2740 | ||
| 179 | 20년 전 | 1828 | ||
| 178 | 20년 전 | 1879 | ||
| 177 | 20년 전 | 2006 | ||
| 176 | 20년 전 | 1816 | ||
| 175 | 20년 전 | 1887 | ||
| 174 | 20년 전 | 1716 | ||
| 173 | 20년 전 | 2074 | ||
| 172 | 20년 전 | 1799 | ||
| 171 | 20년 전 | 2584 | ||
| 170 | 20년 전 | 2301 | ||
| 169 | 20년 전 | 2580 | ||
| 168 | 20년 전 | 1515 | ||
| 167 | 20년 전 | 1602 | ||
| 166 | 20년 전 | 2175 | ||
| 165 | 20년 전 | 1663 | ||
| 164 | 20년 전 | 3793 | ||
| 163 | 20년 전 | 2691 | ||
| 162 | 20년 전 | 2114 | ||
| 161 | 20년 전 | 2822 | ||
| 160 | 20년 전 | 1758 | ||
| 159 | 20년 전 | 1637 | ||
| 158 | 20년 전 | 2589 | ||
| 157 | 20년 전 | 1516 | ||
| 156 | 20년 전 | 1776 | ||
| 155 | 20년 전 | 3254 | ||
| 154 | 20년 전 | 1924 | ||
| 153 | 20년 전 | 1643 | ||
| 152 | 20년 전 | 4978 | ||
| 151 | 20년 전 | 4600 | ||
| 150 | 20년 전 | 3540 | ||
| 149 | 20년 전 | 3817 | ||
| 148 | 20년 전 | 7102 | ||
| 147 | 20년 전 | 3570 | ||
| 146 | 20년 전 | 2651 | ||
| 145 | 20년 전 | 2642 | ||
| 144 | 20년 전 | 7180 | ||
| 143 | 20년 전 | 4626 | ||
| 142 | 20년 전 | 1913 | ||
| 141 | 20년 전 | 3273 | ||
| 140 | 20년 전 | 1992 | ||
| 139 | 20년 전 | 1616 | ||
| 138 | 20년 전 | 2333 | ||
| 137 | 20년 전 | 1810 | ||
| 136 | 20년 전 | 1476 | ||
| 135 | 20년 전 | 1816 | ||
| 134 | 20년 전 | 2992 | ||
| 133 | 20년 전 | 2474 | ||
| 132 | 20년 전 | 1722 | ||
| 131 | 20년 전 | 1668 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기