Line 9: | Line 9: | ||
body { | body { | ||
− | + | margin: 0; | |
− | + | font-family: 'Goudy Old Style Regular',sans-serif !important; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
+ | * {box-sizing: border-box;} | ||
+ | a:link,a:visited {color: black !important;} | ||
.menu-container { | .menu-container { | ||
Line 27: | Line 21: | ||
margin: 0 auto; | margin: 0 auto; | ||
padding-right: 30px; | padding-right: 30px; | ||
− | |||
} | } | ||
.menu > ul { | .menu > ul { | ||
− | |||
− | |||
list-style: none; | list-style: none; | ||
padding: 0; | padding: 0; | ||
position: relative; | position: relative; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
.menu > ul > li { | .menu > ul > li { | ||
float: right; | float: right; | ||
− | |||
padding: 0; | padding: 0; | ||
margin: 0; | margin: 0; | ||
Line 63: | Line 41: | ||
display: block; | display: block; | ||
} | } | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
.menu > ul > li > ul { | .menu > ul > li > ul { | ||
display: none; | display: none; | ||
width: 100%; | width: 100%; | ||
background-color: whitesmoke; | background-color: whitesmoke; | ||
− | |||
position: absolute; | position: absolute; | ||
z-index: 99; | z-index: 99; | ||
Line 79: | Line 51: | ||
margin: 0; | margin: 0; | ||
list-style: none; | list-style: none; | ||
− | |||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
.menu > ul > li > ul.normal-sub { | .menu > ul > li > ul.normal-sub { | ||
Line 106: | Line 58: | ||
left: auto; | left: auto; | ||
padding: 10px 20px; | padding: 10px 20px; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
.menu > ul > li > ul.normal-sub > li a { | .menu > ul > li > ul.normal-sub > li a { | ||
− | |||
padding: 1em 0; | padding: 1em 0; | ||
} | } | ||
Line 183: | Line 125: | ||
<script> | <script> | ||
− | |||
$(document).ready(function () { | $(document).ready(function () { | ||
− | + | $('.menu > ul > li > ul:not(:has(ul))').addClass('normal-sub'); | |
− | + | //导航背景变色+下滑方法 | |
− | + | $(".menu > ul > li").hover(function () { | |
− | + | $(this).css({"background-color":"#f0f0f0"}); | |
− | + | $(this).children("ul").stop(true, false).slideToggle(300); | |
− | + | }); | |
− | + | //背景颜色还原+下拉菜单消失 | |
− | + | $(".menu > ul > li").mouseleave(function () { | |
− | + | $(this).css({"background-color":"#fff"}); | |
− | + | $(this).children("ul").hide(); | |
− | + | }); | |
}); | }); | ||
</script> | </script> |
Revision as of 08:09, 3 October 2018