테스트 사이트 - 개발 중인 베타 버전입니다

간단한 스크립트 결합좀 해주세요!!

개발자가 아니라 잘 모르겠네요 ㅠ_ㅠ
 
두개의 스크립트 기능을 합치고 싶습니다.
하나는 전체서브메뉴를 보여주는 스크립튼데, 출력은 되나,
마우스를 서브메뉴에 올릴시 닫쳐버리구요..
 
또 하나는 서브메뉴가 슬라이딩되어 내려오고 마우스 오버시 잘 작동은 되지만,
메뉴에 올리면 전체 서브메뉴가 내려오진 않습니다.
 
 
아래는 전체서브메뉴 출력만 되는 소스
-------------------------------------------------------------------
<script type="text/javascript">
function init() {
 var gnb = document.getElementById('nav');
 var heading = gnb.getElementsByTagName('li');
 var subMenu = gnb.getElementsByTagName('ul');
 
 // subMenu 위치 초기화
 for (var m=0; m<subMenu.length; m++){
  subMenu[m].style.left = m + 'px';
 }
 for (var i=0; i<heading.length; i++){
  heading[i].onmouseover = heading[i].onmouseout = function() {
   subMenuHandler();
  }
 }
}
function subMenuHandler() {
 var gnb = document.getElementById('nav');
 var subMenu = gnb.getElementsByTagName('ul');
 
 for (var j=0; j<subMenu.length; j++){
  (subMenu[j].style.display == 'block') ? subMenu[j].style.display = 'none' : subMenu[j].style.display = 'block';
 }
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
addLoadEvent(init);
</script>
-------------------------------------------------------------
 
 
아래는 서브메뉴는 내려오고 마우스 오버시 잘 작동하지만,
전체 메뉴가 내려오는것은 아닌, 해당 서브만 내려옵니다..
--------------------------------------------------------------
$(document).ready(function() { 
 $('#nav li').hover(function() {
  $('ul', this).slideDown(200);
  $(this).children('a:first').addClass("hov");
 }, function() {
  $('ul', this).slideUp(10);
  $(this).children('a:first').removeClass("hov");  
 });
});
------------------------------------------------------------
 
 
아래는 html 소스전문----------------------------------------
 
 
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<style>
* { margin: 0; padding: 0; }
body {font-family: Arial, Tahoma, sans-serif; font-size: 11px; color: #232323; }
.wrap { width: 800px;}
/* @group core nav menu */
#nav { margin: 0; padding: 0; list-style: none; border-left: 1px solid #d5dce8; border-right: 1px solid #d5dce8; border-bottom: 1px solid #d5dce8; border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; height: 50px; padding-left: 15px; padding-right: 15px; background: #edf3f7; }
#nav li { float:left; display: block; background: none; position: relative; z-index: 999; margin: 0 1px;}
#nav li a { display: block; padding: 0; font-weight: 700; line-height: 50px; text-decoration: none;  color: #818ba3; zoom: 1; border-left: 1px solid transparent; border-right: 1px solid transparent; padding: 0px 12px; }
#nav li a:hover, #nav li a.hov { background-color: #fff; border-left: 1px solid #d5dce8; border-right: 1px solid #d5dce8; color: #576482; }
/* @group subnav */
#nav ul {position: absolute; left:-500px; display: none; margin: 0; padding: 0; list-style: none; border:1px #d5dce8 solid;} 
#nav ul li { width:100px; position: relative; left:0px; border-top: 1px solid #fff; text-align: left; }
#nav ul li:hover { border-left:0px solid transparent; border-right: 0px solid transparent;background:#eee }
   
#nav ul a { display: block; height: 20px; line-height: 20px; padding: 8px 5px; color: #666; border-bottom: 1px solid transparent; text-transform:  uppercase; color: #797979; font-weight: normal; }
#nav ul a:hover { text-decoration: none; border-right-color: transparent; border-left-color: transparent; background: transparent; color: #4e4e4e; }
* html #nav ul { margin: 0 0 0 -2px; }
/** @group clearfix **/
.clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
.clearfix { display: inline-block; }
 
html[xmlns] .clearfix { display: block; }
* html .clearfix { height: 1%; }
</style>
</head>
<body>
<div class="wrap">
 <ul id="nav">
  <li><a href="#">Homepage</a></li>
  <li><a href="#">About the Mag</a>
   <ul>
    <li><a href="#">Company</a></li>
    <li><a href="#">Authors</a></li>
    <li><a href="#">Write for Us?</a></li>
    <li><a href="#">Advertising</a></li>
    <li><a href="#">Get in Touch</a></li>
   </ul>
  </li>
  <li><a href="#">Freebies</a>
   <ul>
    <li><a href="#">PSD</a></li>
    <li><a href="#">AI Vectors</a></li>
    <li><a href="#">Patterns</a></li>
    <li><a href="#">Icons</a></li>
   </ul>   
  </li>
  <li><a href="#">Tutorials</a>
   <ul>
    <li><a href="#">HTML5</a></li>
    <li><a href="#">CSS3</a></li>
    <li><a href="#">jQuery</a></li>
    <li><a href="#">PHP MySQL</a></li>
    <li><a href="#">Ruby on Rails</a></li>
   </ul>
  </li>
  <li><a href="#">Web Tools</a>
   <ul>
    <li><a href="#">Performance</a></li>
    <li><a href="#">Browser Testing</a></li>
    <li><a href="#">CMS Plugins</a></li>
    <li><a href="#">Cheat Sheets</a></li>
   </ul>
  </li>
  <li><a href="#">Originals</a>
   <ul>
    <li><a href="#">Website Design</a></li>
    <li><a href="#">Mobile</a></li>
    <li><a href="#">User Interface</a></li>
    <li><a href="#">Freelancing</a></li>
    <li><a href="#">Inspiration</a></li>
   </ul>
  </li>
 </ul>
</div>
-----------------------------------------------------------
 
제가 바라는 기능은,
어떤 메뉴에 마우스를 올리던, 전체 서브메뉴가 내려오고,
그 서브메뉴에 마우스를 올릴시엔, 2번째 스크립트에 있는,
오버기능이 작동되었으면 좋겠습니다.
 
고수분들 도와주세요~ㅠ_ㅠ

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

죄송해요

게시글 목록

번호 제목
16046
16039
24343
30035
16035
16033
16031
3896
30030
3892
16029
16026
16024
16020
16016
16013
16010
3889
30027
16009
16008
16007
16005
30025
16001
15998
3886
30022
3883
15995
15992
30020
15991
15989
15980
15977
3878
15976
3871
26248
3868
3861
15972
15970
15967
15964
15954
26245
15953
15952
15948
15947
30016
15944
15943
15942
15940
15938
15935
24342
3855
15933
15930
3850
15928
15925
30013
30012
15922
15921
15918
3843
3842
15915
15912
15911
3840
15904
26244
26243
3835
15902
26239
15898
3828
26230
15897
26227
3826
26219
15893
15886
3807
3800
3796
15885
15881
15879
15877
15864