2014-01-30 7 views
0

코딩에 익숙하며 드롭 다운 메뉴를 사용하는 데 문제가 있습니다.탭 막대의 CSS 드롭 다운 메뉴가 사라짐

커서가 해당 탭을 가리키면 메뉴가 올바르게 드롭되지만 커서를 실제 드롭 다운 하위 카테고리로 이동하면 메뉴가 사라집니다. 도움을 사전에

<!DOCTYPE html> 
<html> 
<head> 
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' /> 
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' /> 
<link rel='stylesheet' type='text/css' href='styles.css' /> 
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'>  
</script> 
<script type='text/javascript' src='menu_jquery.js'></script> 
</head> 
<body> 
<h1>Sugar Mule</h1> 
<div id='cssmenu'> 
<ul> 
    <li class='active'><a href='index.html'><span>Home</span></a></li> 
    <li class='has-sub'><a href='about.html'><span>About</span></a> 
     <ul> 
     <li><a href='why.html'><span>Why Sugar Mule?</span></a></li> 
     <li><a href='staff.html'><span>Staff</span></a></li> 
     <li class='last'><a href='contact.html'><span>Contact</span></a></li> 
     </ul> 
    </li> 
    <li><a href='issues.html'><span>Issues</span></a></li> 
    <li><a href='books.html'><span>Books</span></a></li> 
    <li><a href='submit.html'><span>Submit</span></a></li> 
    <li class='last'><a href='links.html'><span>Links</span></a></li> 
</ul> 
</div> 
<center><img src="logo.png" alt="Logo" width="700" height="450"></center> 
</body> 
</html> 

감사 : 나는에 넣어려고

#cssmenu { 
    position: relative; 
    height: 44px; 
    background: #1d309e; 
    width: auto; 
    z-index: 100; 
} 
#cssmenu ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    line-height: 1; 
} 
#cssmenu > ul { 
    position: relative; 
    display: block; 
    background: #1d309e; 
    height: 32px; 
    width: 100%; 
    z-index: 99; 
    text-transform:lowercase; 
} 
#cssmenu > ul > li { 
    display: block; 
    position: relative; 
    float: left; 
    margin: 0; 
    padding: 0; 
    font-family: tahoma, "Trebuchet MS", verdana, helvetica, arial, sans-serif; 
    text-transform:lowercase 
    z-index: 100 
} 
#cssmenu > ul > #menu-button { 
    display: none; 
} 
#cssmenu ul li a { 
    display: block; 
    font-family: tahoma, "Trebuchet MS", verdana, helvetica, arial, sans-serif; 
    text-decoration: none; 
    text-transform:lowercase 
} 
#cssmenu > ul > li > a { 
    font-size: 15px; 
    padding: 0px 80px; 
    color: #ffffff; 
    -webkit-transition: color 0.25s ease-out; 
    -moz-transition: color 0.25s ease-out; 
    -ms-transition: color 0.25s ease-out; 
    -o-transition: color 0.25s ease-out; 
    transition: color 0.25s ease-out; 
    text-transform:lowercase 
} 
#cssmenu > ul > li.has-sub > a { 
    padding-right: 32px; 
} 
#cssmenu > ul > li:hover > a { 
    color: #fff203; 
} 
#cssmenu li.has-sub::after { 
    display: block; 
    content: ''; 
    position: absolute; 
    width: 0; 
    height: 0; 
    z-index: 100 
} 
#cssmenu > ul > li.has-sub::after { 
    right: 10px; 
    top: 20px; 
    border: 5px solid transparent; 
    border-top-color: #ffffff; 
} 
#cssmenu > ul > li:hover::after { 
    border-top-color: #fff203; 
} 
#indicatorContainer { 
    position: absolute; 
    height: 12px; 
    width: 100%; 
    bottom: 0px; 
    overflow: hidden; 
    z-index: 100; 
} 
#pIndicator { 
    position: absolute; 
    height: 0; 
    width: 100%; 
    border: 12px solid transparent; 
    border-top-color: #2b2f3a; 
    z-index: 100; 
    -webkit-transition: left .25s ease; 
    -moz-transition: left .25s ease; 
    -ms-transition: left .25s ease; 
    -o-transition: left .25s ease; 
    transition: left .25s ease; 
} 
#cIndicator { 
    position: absolute; 
    height: 0; 
    width: 100%; 
    border: 12px solid transparent; 
    border-top-color: #2b2f3a; 
    top: -12px; 
    right: 100%; 
    z-index: 100; 
} 
#cssmenu ul ul { 
    position: absolute; 
    left: -9999px; 
    top: 70px; 
    opacity: 0; 
    -webkit-transition: opacity .3s ease, top .25s ease; 
    -moz-transition: opacity .3s ease, top .25s ease; 
    -ms-transition: opacity .3s ease, top .25s ease; 
    -o-transition: opacity .3s ease, top .25s ease; 
    transition: opacity .3s ease, top .25s ease; 
    z-index: 100; 
} 
#cssmenu ul ul ul { 
    top: 37px; 
    padding-left: 5px; 
} 
#cssmenu ul ul li { 
    position: relative; 
    z-index: 100 
} 
#cssmenu > ul > li:hover > ul { 
    left: auto; 
    top: 44px; 
    opacity: 1; 
} 
#cssmenu ul ul li:hover > ul { 
    left: 170px; 
    top: 0; 
    opacity: 1; 
} 
#cssmenu ul ul li a { 
    width: 130px; 
    border-bottom: 1px solid #eee; 
    padding: 10px 20px; 
    font-size: 12px; 
    color: #1d309e; 
    background: #fff; 
    -webkit-transition: all .35s ease; 
    -moz-transition: all .35s ease; 
    -ms-transition: all .35s ease; 
    -o-transition: all .35s ease; 
    transition: all .35s ease; 
} 
#cssmenu ul ul li:hover > a { 
    background: #f6f6f6; 
    color: #ffee00; 
} 
#cssmenu ul ul li:last-child > a, 
#cssmenu ul ul li.last > a { 
    border-bottom: 0; 
} 
.submenuArrow { 
border: 6px solid transparent; 
    width: 0; 
    height: 0; 
    border-bottom-color: #fff; 
    position: absolute; 
    top: -12px; 
} 
#cssmenu ul ul li.has-sub::after { 
    border: 4px solid transparent; 
    border-left-color: #1d309e; 
    right: 10px; 
    top: 12px; 
    -moz-transition: all .2s ease; 
    -ms-transition: all .2s ease; 
    -o-transition: all .2s ease; 
    transition: all .2s ease; 
    -webkit-transition: -webkit-transform 0.2s ease, right 0.2s ease; 
} 
#cssmenu ul ul li.has-sub:hover::after { 
    border-left-color: #fff; 
    right: -5px; 
    -webkit-transform: rotateY(180deg); 
    -ms-transform: rotateY(180deg); 
    -moz-transform: rotateY(180deg); 
    -o-transform: rotateY(180deg); 
    transform: rotateY(180deg); 
} 
@media all and (max-width: 800px), only screen and (-webkit-min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min--moz-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (-o-min-device-pixel-ratio: 2/1) and (max-width: 1024px), only screen and (min-device-pixel-ratio: 2) and (max-width: 1024px), only screen and (min-resolution: 192dpi) and (max-width: 1024px), only screen and (min-resolution: 2dppx) and (max-width: 1024px) { 
    #cssmenu { 
    width: auto; 
    } 
    #cssmenu ul { 
    width: auto; 
    } 
    #cssmenu .submenuArrow, 
    #cssmenu #indicatorContainer { 
    display: none; 
    } 
    #cssmenu > ul { 
    height: auto; 
    display: block; 
    } 
    #cssmenu > ul > li { 
    float: none; 
    } 
    #cssmenu li, 
    #cssmenu > ul > li { 
    display: none; 
    } 
    #cssmenu ul ul, 
    #cssmenu ul ul ul, 
    #cssmenu ul > li:hover > ul, 
    #cssmenu ul ul > li:hover > ul { 
    position: relative; 
    left: auto; 
    top: auto; 
    opacity: 1; 
    padding-left: 0; 
    z-index: 100 
    } 
    #cssmenu ul .has-sub::after { 
    display: none; 
    } 
    #cssmenu ul li a { 
    padding: 12px 20px; 
    } 
    #cssmenu ul ul li a { 
    border: 0; 
    background: none; 
    width: auto; 
    padding: 8px 35px; 
    } 
    #cssmenu ul ul li:hover > a { 
    background: none; 
    color: #ffee00; 
    } 
    #cssmenu ul ul ul a { 
    padding: 8px 50px; 
    } 
    #cssmenu ul ul ul ul a { 
    padding: 8px 65px; 
    } 
    #cssmenu ul ul ul ul ul a { 
    padding: 8px 80px; 
    } 
    #cssmenu ul ul ul ul ul ul a { 
    padding: 8px 95px; 
    } 
    #cssmenu > ul > #menu-button { 
    display: block; 
    cursor: pointer; 
    } 
    #cssmenu #menu-button > a { 
    padding: 14px 20px; 
    } 
    #cssmenu ul.open li, 
    #cssmenu > ul.open > li { 
    display: block; 
    } 
    #cssmenu > ul.open > li#menu-button > a { 
    color: #fff; 
    border-bottom: 1px solid rgba(150, 150, 150, 0.1); 
    } 
    #cssmenu #menu-button::after { 
    display: block; 
    content: ''; 
    position: absolute; 
    height: 3px; 
    width: 22px; 
    border-top: 2px solid #ffffff; 
    border-bottom: 2px solid #ffffff; 
    right: 20px; 
    top: 15px; 
    z-index: 100 
    } 
    #cssmenu #menu-button::before { 
    display: block; 
    content: ''; 
    position: absolute; 
    height: 3px; 
    width: 22px; 
    border-top: 2px solid #ffffff; 
    right: 20px; 
    top: 25px; 
    z-index: 100 
    } 
    #cssmenu ul.open #menu-button::after, 
#cssmenu ul.open #menu-button::before { 
    border-color: #fff; 
    } 
} 

을 그리고 여기에 HTML 페이지입니다 :

여기 탭에 대한 CSS입니다!

답변

0

드롭 다운 #cssmenu > ul > li:hover > ul의 상단 오프셋이 44px이므로 http://jsfiddle.net/Varinder/bg763/

:

은 그럼 당신은 확실히 모든 최상위 레벨이 #cssmenu > ul > li > a이이어야 44px

을 heres ammended CSS

#cssmenu > ul > li > a { 
    ... 
    min-height:44px; 
    ... 
} 

바이올린있는 링크해야합니다

관련 문제