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는 수정하지 않았으며 주석처리만 해놓았습니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 381 | ||
| 7929 | 9년 전 | 277 | ||
| 7928 | 9년 전 | 383 | ||
| 7927 | 9년 전 | 306 | ||
| 7926 | 9년 전 | 652 | ||
| 7925 | 9년 전 | 325 | ||
| 7924 | 9년 전 | 302 | ||
| 7923 | 9년 전 | 326 | ||
| 7922 | 9년 전 | 349 | ||
| 7921 | 9년 전 | 380 | ||
| 7920 | 9년 전 | 302 | ||
| 7919 | 9년 전 | 318 | ||
| 7918 | 9년 전 | 479 | ||
| 7917 | 9년 전 | 319 | ||
| 7916 | 9년 전 | 386 | ||
| 7915 | 9년 전 | 377 | ||
| 7914 | 9년 전 | 389 | ||
| 7913 | 9년 전 | 514 | ||
| 7912 | 9년 전 | 388 | ||
| 7911 | 9년 전 | 335 | ||
| 7910 | 9년 전 | 374 | ||
| 7909 | 9년 전 | 477 | ||
| 7908 | 9년 전 | 377 | ||
| 7907 | 9년 전 | 333 | ||
| 7906 | 9년 전 | 347 | ||
| 7905 | 9년 전 | 338 | ||
| 7904 | 9년 전 | 310 | ||
| 7903 | 9년 전 | 312 | ||
| 7902 | 9년 전 | 523 | ||
| 7901 |
|
9년 전 | 721 | |
| 7900 | 9년 전 | 550 | ||
| 7899 | 9년 전 | 352 | ||
| 7898 | 9년 전 | 346 | ||
| 7897 | 9년 전 | 304 | ||
| 7896 | 9년 전 | 331 | ||
| 7895 | 9년 전 | 435 | ||
| 7894 | 9년 전 | 359 | ||
| 7893 | 9년 전 | 296 | ||
| 7892 | 9년 전 | 344 | ||
| 7891 | 9년 전 | 728 | ||
| 7890 | 9년 전 | 1180 | ||
| 7889 | 9년 전 | 738 | ||
| 7888 |
limsy1987
|
9년 전 | 532 | |
| 7887 | 9년 전 | 516 | ||
| 7886 | 9년 전 | 400 | ||
| 7885 | 9년 전 | 374 | ||
| 7884 | 9년 전 | 380 | ||
| 7883 | 9년 전 | 369 | ||
| 7882 | 9년 전 | 386 | ||
| 7881 | 9년 전 | 407 | ||
| 7880 | 9년 전 | 532 | ||
| 7879 | 9년 전 | 426 | ||
| 7878 | 9년 전 | 1172 | ||
| 7877 | 9년 전 | 721 | ||
| 7876 | 9년 전 | 447 | ||
| 7875 | 9년 전 | 526 | ||
| 7874 |
|
9년 전 | 786 | |
| 7873 | 9년 전 | 486 | ||
| 7872 | 9년 전 | 630 | ||
| 7871 | 9년 전 | 454 | ||
| 7870 | 9년 전 | 584 | ||
| 7869 | 9년 전 | 398 | ||
| 7868 | 9년 전 | 396 | ||
| 7867 | 9년 전 | 393 | ||
| 7866 | 9년 전 | 456 | ||
| 7865 | 9년 전 | 414 | ||
| 7864 | 9년 전 | 476 | ||
| 7863 | 9년 전 | 466 | ||
| 7862 | 9년 전 | 443 | ||
| 7861 | 9년 전 | 600 | ||
| 7860 | 9년 전 | 599 | ||
| 7859 | 9년 전 | 376 | ||
| 7858 | 9년 전 | 681 | ||
| 7857 | 9년 전 | 1034 | ||
| 7856 | 9년 전 | 493 | ||
| 7855 | 9년 전 | 714 | ||
| 7854 | 9년 전 | 703 | ||
| 7853 | 9년 전 | 557 | ||
| 7852 | 9년 전 | 475 | ||
| 7851 | 9년 전 | 459 | ||
| 7850 | 9년 전 | 558 | ||
| 7849 | 9년 전 | 327 | ||
| 7848 | 9년 전 | 379 | ||
| 7847 | 9년 전 | 599 | ||
| 7846 | 9년 전 | 422 | ||
| 7845 | 9년 전 | 378 | ||
| 7844 | 9년 전 | 371 | ||
| 7843 | 9년 전 | 383 | ||
| 7842 | 9년 전 | 372 | ||
| 7841 | 9년 전 | 359 | ||
| 7840 | 9년 전 | 368 | ||
| 7839 | 9년 전 | 408 | ||
| 7838 | 9년 전 | 488 | ||
| 7837 | 9년 전 | 333 | ||
| 7836 | 9년 전 | 371 | ||
| 7835 | 9년 전 | 450 | ||
| 7834 |
|
9년 전 | 1176 | |
| 7833 | 9년 전 | 388 | ||
| 7832 | 9년 전 | 389 | ||
| 7831 | 9년 전 | 522 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기