- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道为什么当菜单完全展开时以及在移动设备上向下滚动时菜单实际上会折叠。请帮忙。链接到该站点,请注意我还没有做太多。 explorenewzealand.net如果需要,我会把代码放在下面。只要问,我会评论你想要的代码。非常感谢,如有任何帮助,我们将不胜感激
HTML:
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Home|Tourist Advice|Explore New Zealand</title>
<link rel="stylesheet" type="text/css" href="styles.css" media="screen" />
<meta name="viewport" content="width=device-width, user-scalable=no">
</head>
<body>
<div id='cssmenu'>
<ul>
<li class="active"><a href=""><span>Home</span></a></li>
<li class="has-sub"><a href="aboutnewzealand.html"><span>About New Zealand</span></a>
<ul>
<li class="has-sub"><a href="#"><span>South Island</span></a>
<ul>
<li><a href="aboutnewzealand/marlborough.html"><span>Marlborough</span></a></li>
<li><a href="aboutnewzealand/nelson.html"><span>Nelson</span></a></li>
<li><a href="aboutnewzealand/westcoast.html"><span>West Coast</span></a></li>
<li><a href="aboutnewzealand/canterbury.html"><span>Canterbury</span></a></li>
<li><a href="aboutnewzealand/queenstown-lakes.html"><span>Queenstown Lakes</span></a></li>
<li><a href="aboutnewzealand/fiordland.html"><span>Fiordland</span></a></li>
<li><a href="aboutnewzealand/otago.html"><span>Otago</span></a></li>
<li class="last"><a href="aboutnewzealand/southland.html"><span>Southland</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="has-sub"><a href="accommodation.html"><span>Accommodation</span></a>
<ul>
<li class="has-sub"><a href="#"><span>South Island </span></a>
<ul>
<li><a href="accommodation/marlborough.html"><span>Marlborough</span></a></li>
<li><a href="accommodation/nelson.html"><span>Nelson</span></a></li>
<li><a href="accommodation/westcoast.html"><span>West Coast</span></a></li>
<li><a href="accommodation/canterbury.html"><span>Canterbury</span></a></li>
<li><a href="accommodation/queenstown-lakes.html"><span>Queenstown Lakes</span></a></li>
<li><a href="accommodation/fiordland.html"><span>Fiordland</span></a></li>
<li><a href="accommodation/otago.html"><span>Otago</span></a></li>
<li class="last"><a href="accommodation/southland.html"><span>Southland</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="has-sub"><a href="attractions.html"><span>Attractions & Activities</span></a>
<ul>
<li class="has-sub"><a href="#"><span>South Island </span></a>
<ul>
<li><a href="attractions&activities/marlborough.html"><span>Marlborough</span></a></li>
<li><a href="attractions&activities/nelson.html"><span>Nelson</span></a></li>
<li><a href="attractions&activities/westcoast.html"><span>West Coast</span></a></li>
<li><a href="attractions&activities/canterbury.html"><span>Canterbury</span></a></li>
<li><a href="attractions&activities/queenstown-lakes.html"><span>Queenstown Lakes</span></a></li>
<li><a href="attractions&activities/fiordland.html"><span>Fiordland</span></a></li>
<li><a href="attractions&activities/otago.html"><span>Otago</span></a></li>
<li class="last"><a href="attractions&activities/southland.html"><span>Southland</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="has-sub last"><a href="dining.html"><span>Dining</span></a>
<ul>
<li class="has-sub"><a href="#"><span>South Island </span></a>
<ul>
<li><a href="dining/marlborough.html"><span>Marlborough</span></a></li>
<li><a href="dining/nelson.html"><span>Nelson</span></a></li>
<li><a href="dining/westcoast.html"><span>West Coast</span></a></li>
<li><a href="dining/canterbury.html"><span>Canterbury</span></a></li>
<li><a href="dining/queenstown-lakes.html"><span>Queenstown Lakes</span></a></li>
<li><a href="fiordland.html"><span>Fiordland</span></a></li>
<li><a href="otago.html"><span>Otago</span></a></li>
<li class="last"><a href="southland.html"><span>Southland </span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
CSS:
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a,
#cssmenu #menu-button {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu:after,
#cssmenu > ul:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu #menu-button {
display: none;
}
#cssmenu {
width: auto;
border-radius: 5px;
font-family: 'Open Sans', Helvetica, sans-serif;
background: #3db2e1;
background: -o-linear-gradient(top, #69c4e8, #21a1d4);
background: -ms-linear-gradient(top, #69c4e8, #21a1d4);
background: -webkit-linear-gradient(top, #69c4e8, #21a1d4);
background: -moz-linear-gradient(top, #69c4e8, #21a1d4);
background: linear-gradient(to bottom, #69c4e8, #21a1d4);
box-shadow: inset 0 -3px 0 #1f97c7, inset 0 -3px 3px #1f9acc, inset 0 2px 2px #9ad7ef, inset 1px 0 2px #22a4d9, inset -1px 0 2px #22a4d9, 0 1px 1px rgba(0, 0, 0, 0.1), 0 2px 2px rgba(0, 0, 0, 0.06), 0 3px 3px rgba(0, 0, 0, 0.17), 2px 1px 2px rgba(0, 0, 0, 0.05), -2px 1px 2px rgba(0, 0, 0, 0.05);
}
#cssmenu.align-center > ul {
font-size: 0;
text-align: center;
}
#cssmenu.align-center ul ul {
text-align: left;
}
#cssmenu.align-center > ul > li {
display: inline-block;
float: none;
}
#cssmenu.align-right > ul > li {
float: right;
}
#cssmenu.align-right ul ul {
text-align: right;
}
#cssmenu > ul > li {
float: left;
}
#cssmenu > ul > li > a {
padding: 20px 25px;
font-size: 13px;
color: #ffffff;
text-transform: uppercase;
letter-spacing: 1px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
font-weight: 700;
text-decoration: none;
-webkit-transition: color .2s ease;
-moz-transition: color .2s ease;
-ms-transition: color .2s ease;
-o-transition: color .2s ease;
transition: color .2s ease;
}
#cssmenu > ul > li:hover > a,
#cssmenu > ul > li > a:hover,
#cssmenu > ul > li.active > a {
color: #cae5fd;
}
#cssmenu > ul > li.has-sub > a {
padding-right: 40px;
}
#cssmenu ul > li.has-sub > a:after {
content: '';
position: absolute;
right: 5px;
top: 17.5px;
display: block;
width: 18px;
height: 18px;
border-radius: 9px;
background: #3db2e1;
background: -webkit-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -ms-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -moz-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -o-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: linear-gradient(to bottom, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
box-shadow: inset 0 -1px 1px #209ed0, inset 0 2px 1px #7fcceb;
background-size: 36px 36px;
background-position: 0 0;
background-repeat: no-repeat;
-webkit-transition: all 0.1s ease-out;
-moz-transition: all 0.1s ease-out;
-ms-transition: all 0.1s ease-out;
-o-transition: all 0.1s ease-out;
transition: all 0.1s ease-out;
}
#cssmenu ul > li.has-sub:hover > a:after {
background-position: 0 -18px;
}
#cssmenu ul > li.has-sub > a:before {
content: '';
position: absolute;
right: 11px;
top: 25.5px;
display: block;
width: 0;
height: 0;
border: 3px solid transparent;
border-top-color: #ffffff;
z-index: 99;
}
#cssmenu ul > li.has-sub:hover > a:before {
border-top-color: #19799f;
}
#cssmenu ul ul {
position: absolute;
left: -9999px;
opacity: 0;
-webkit-transition: top .2s ease, opacity .2s ease;
-moz-transition: top .2s ease, opacity .2s ease;
-ms-transition: top .2s ease, opacity .2s ease;
-o-transition: top .2s ease, opacity .2s ease;
transition: top .2s ease, opacity .2s ease;
}
#cssmenu > ul > li > ul {
top: 91px;
padding-top: 8px;
border-radius: 5px;
}
#cssmenu > ul > li:hover > ul {
left: auto;
top: 51px;
opacity: 1;
}
#cssmenu.align-right > ul > li:hover > ul {
right: 0;
}
#cssmenu ul ul ul {
top: 40px;
}
#cssmenu ul ul > li:hover > ul {
top: 0;
left: 178px;
padding-left: 10px;
opacity: 1;
}
#cssmenu.align-right ul ul > li:hover > ul {
left: auto;
right: 178px;
padding-left: 0;
padding-right: 10px;
opacity: 1;
}
#cssmenu ul ul li a {
width: 180px;
padding: 12px 25px;
font-size: 13px;
font-weight: 700;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
color: #ffffff;
text-decoration: none;
background: #3db2e1;
-webkit-transition: color .2s ease;
-moz-transition: color .2s ease;
-ms-transition: color .2s ease;
-o-transition: color .2s ease;
transition: color .2s ease;
}
#cssmenu ul ul li:hover > a,
#cssmenu ul ul li > a:hover,
#cssmenu ul ul li.active > a {
color: #cae5fd;
}
#cssmenu ul ul li:first-child > a {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
box-shadow: inset 0 2px 2px #88d0ed;
}
#cssmenu ul ul li:last-child > a {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: inset 0 -3px 0 #27a9de, inset 0 -3px 3px #1f9acc, 0 1px 1px rgba(0, 0, 0, 0.03), 0 2px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.13);
}
#cssmenu ul ul > li.has-sub > a:after {
right: 12px;
top: 9.5px;
background: #3db2e1;
background: -webkit-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -ms-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -moz-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -o-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: linear-gradient(to bottom, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
box-shadow: inset 0 -1px 1px #209ed0, inset 0 2px 1px #7fcceb;
background-size: 36px 36px;
background-position: 0 0;
background-repeat: no-repeat;
}
#cssmenu.align-right ul ul > li.has-sub > a:after {
right: auto;
left: 12px;
}
#cssmenu ul ul > li.has-sub:hover > a:after {
background-position: 0 -18px;
}
#cssmenu ul ul > li.has-sub > a:before {
top: 15.5px;
right: 16px;
border-top-color: transparent;
border-left-color: #ffffff;
}
#cssmenu.align-right ul ul > li.has-sub > a:before {
top: 15.5px;
right: auto;
left: 16px;
border-top-color: transparent;
border-right-color: #ffffff;
border-left-color: transparent;
}
#cssmenu ul ul > li.has-sub:hover > a:before {
border-top-color: transparent;
border-left-color: #1c89b5;
}
#cssmenu.align-right ul ul > li.has-sub:hover > a:before {
border-top-color: transparent;
border-left-color: transparent;
border-right-color: #1c89b5;
}
@media all and (max-width: 768px), 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: 100%;
}
#cssmenu ul,
#cssmenu ul ul,
#cssmenu ul ul ul,
#cssmenu > ul,
#cssmenu.align-center > ul,
#cssmenu > ul > li > ul,
#cssmenu > ul > li:hover > ul,
#cssmenu ul ul li:hover > ul,
#cssmenu ul ul ul li:hover > ul,
#cssmenu.align-right ul ul,
#cssmenu.align-right ul ul li:hover > ul,
#cssmenu.align-right ul ul ul li:hover > ul {
position: relative;
left: 0;
right: auto;
top: 0;
width: 100%;
display: none;
padding: 0;
opacity: 1;
text-align: left;
}
#cssmenu ul li {
width: 100%;
border-top: 1px solid rgba(120, 120, 120, 0.2);
}
#cssmenu > ul > li > a,
#cssmenu ul ul li a,
#cssmenu ul ul li:first-child > a,
#cssmenu ul ul li:last-child > a {
width: 100%;
border-radius: 0;
box-shadow: none;
background: none;
}
#cssmenu ul li a {
padding-left: 12.5px;
}
#cssmenu ul ul li a {
padding: 14px 25px 14px 27.5px;
}
#cssmenu ul ul ul li a {
padding-left: 42.5px;
}
#cssmenu ul ul ul ul li a {
padding-left: 57.5px;
}
#cssmenu > ul > li.has-sub > a:after,
#cssmenu > ul > li.has-sub > a:before,
#cssmenu ul ul li.has-sub > a:after,
#cssmenu ul ul li.has-sub > a:before {
display: none;
}
#cssmenu #menu-button {
position: relative;
display: block;
padding: 20px;
padding-left: 12.5px;
cursor: pointer;
font-size: 13px;
color: #ffffff;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
}
#cssmenu .submenu-button {
position: absolute;
right: 0;
display: block;
width: 53px;
height: 53px;
border-left: 1px solid rgba(120, 120, 120, 0.2);
z-index: 10;
cursor: pointer;
}
#cssmenu ul ul .submenu-button {
height: 41px;
}
#cssmenu ul .submenu-button:after,
#cssmenu #menu-button:after {
content: '';
position: absolute;
right: 12.5px;
top: 12.5px;
display: block;
width: 28px;
height: 28px;
border-radius: 15px;
background: #3db2e1;
background: -webkit-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -ms-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -moz-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: -o-linear-gradient(top, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
background: linear-gradient(to bottom, #58bde5 0%, #4ab7e3 25%, #2babde 50%, #58bde5 75%, #4ab7e3 100%);
box-shadow: inset 0 -1px 1px #209ed0, inset 0 2px 1px #7fcceb;
background-size: 56px 56px;
background-position: 0 0;
background-repeat: no-repeat;
-webkit-transition: all 0.1s ease-out;
-moz-transition: all 0.1s ease-out;
-ms-transition: all 0.1s ease-out;
-o-transition: all 0.1s ease-out;
transition: all 0.1s ease-out;
}
#cssmenu ul .submenu-button.submenu-opened:after,
#cssmenu #menu-button.menu-opened:after {
background-position: 0 -28px;
}
#cssmenu ul ul .submenu-button:after {
top: 6.5px;
}
#cssmenu #menu-button:before,
#cssmenu .submenu-button:before {
content: '';
position: absolute;
right: 22.5px;
top: 25.5px;
display: block;
width: 0;
height: 0;
border: 4px solid transparent;
border-top-color: #ffffff;
z-index: 99;
}
#cssmenu ul ul .submenu-button:before {
top: 19.5px;
}
#cssmenu #menu-button.menu-opened:before,
#cssmenu .submenu-button.submenu-opened:before {
border-top-color: #19799f;
}
}
.css3menu {
width: 100%;
margin: 0;
padding: 3px 0 3px 0;
list-style: none;
background: #111;
background: -moz-linear-gradient(
top,
#2da2de 0%,
#2da2de 16%,
#2da2de);
background: -webkit-gradient(
linear, left top, left bottom,
from(#2da2de),
color-stop(0.16, #2da2de),
to(#2da2de));
background: -ms-linear-gradient(
top,
#2da2de 0%,
#2da2de 16%,
#2da2de 100%);
background: -o-linear-gradient(
top,
#2da2de 0%,
#2da2de 16%,
#2da2de 100%);
background: linear-gradient(
to bottom,
#2da2de 0%,
#2da2de 16%,
#2da2de 100%);
-moz-border-radius: 14px;
-webkit-border-radius: 14px;
border-radius: 14px;
border: 0px solid #2795ce;
-moz-box-shadow:
0px 0px 3px rgba(0,0,0,0.0),
inset 0px 0px 2px rgba(254,255,255,1);
-webkit-box-shadow:
0px 0px 3px rgba(0,0,0,0.0),
inset 0px 0px 2px rgba(254,255,255,1);
box-shadow:
0px 0px 3px rgba(0,0,0,0.0),
inset 0px 0px 2px rgba(254,255,255,1);
}
.css3menu li{
float: left;
padding: 0px 8px 0px 0px;
position: relative;
}
.css3menu li:first-child{
margin: 0 0 0 25px;
border-left: 0px;
}
.css3menu li:last-child{
border-right: 0px;
}
.css3menu li:hover{
background: -moz-linear-gradient(
top,
rgba(255, 56, 92, 0.10) 0%,
rgba(37, 139, 193, 0.10) 25%,
rgba(45, 162, 222, 0.10) 50%,
rgba(48, 180, 250, 0.10) 75%,
rgba(48, 180, 250, 0.10));
background: -webkit-gradient(
linear, left top, left bottom,
from(rgba(255, 56, 92, 0.10)),
color-stop(0.25, rgba(37, 139, 193, 0.10)),
color-stop(0.50, rgba(45, 162, 222, 0.10)),
color-stop(0.75, rgba(48, 180, 250, 0.10)),
to(rgba(48, 180, 250, 0.10)));
background: -ms-linear-gradient(
top,
rgba(255, 56, 92, 0.10) 0%,
rgba(37, 139, 193, 0.10) 25%,
rgba(45, 162, 222, 0.10) 50%,
rgba(48, 180, 250, 0.10) 75%,
rgba(48, 180, 250, 0.10) 100%);
background: -o-linear-gradient(
top,
rgba(255, 56, 92, 0.10) 0%,
rgba(37, 139, 193, 0.10) 25%,
rgba(45, 162, 222, 0.10) 50%,
rgba(48, 180, 250, 0.10) 75%,
rgba(48, 180, 250, 0.10) 100%);
background: linear-gradient(
to bottom,
rgba(255, 56, 92, 0.10) 0%,
rgba(37, 139, 193, 0.10) 25%,
rgba(45, 162, 222, 0.10) 50%,
rgba(48, 180, 250, 0.10) 75%,
rgba(48, 180, 250, 0.10) 100%);
}
.css3menu li:active{
background: rgba(255, 0, 0, 0.10);
}
.css3menu a{
float: left;
padding: 10px 10px;
color: #999;
font-family: Arial, Helvetica, sans-serif;
color: #ffffff;
font-size: 16px;
text-decoration: none;
text-shadow:
0px 0px 0px rgba(0,0,0,0.6),
0px 0px 7px rgba(254,255,255,0.1);
}
.css3menu a:hover{
color: #ffffff;
}
.css3menu a:active{
color: #ffffff;
}
.css3menu li:hover > ul{
display: block;
}
.css3menu li:active > ul{
display: block;
}
.css3menu ul{
list-style: none;
margin: 0;
padding: 0;
display: none;
position: absolute;
top: 36px;
left: 0;
z-index: 99999;
background: -moz-linear-gradient(
top,
#ffffff 0%,
#ebf4c3);
background: -webkit-gradient(
linear, left top, left bottom,
from(#ffffff),
to(#ebf4c3));
background: -ms-linear-gradient(
top,
#ffffff 0%,
#ebf4c3 100%);
background: -o-linear-gradient(
top,
#ffffff 0%,
#ebf4c3 100%);
background: linear-gradient(
to bottom,
#ffffff 0%,
#ebf4c3 100%);
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
border: 1px solid #6d8000;
}
.css3menu ul li{
border-left: 0px;
border-right: 0px;
float: none;
margin: 0;
padding: 0;
display: block;
-moz-box-shadow: 0 1px 0 #111111, 0 1px 0 #777777;
-webkit-box-shadow: 0 1px 0 #111111, 0 1px 0 #777777;
box-shadow: 0 1px 0 #111111, 0 1px 0 #777777;
}
.css3menu ul li:first-child{
padding-left: 0px;
margin: 0;
}
.css3menu ul li:last-child{
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.css3menu ul li:hover{
background: rgba(255, 0, 0, 0.10);
}
.css3menu ul li:active{
background: rgba(255, 0, 0, 0.10);
}
.css3menu ul a{
color: #141414;
padding: 10px;
height: auto;
line-height: 1;
display: block;
white-space: nowrap;
float: none;
text-transform: none;
height: 16px;
width: 180px;
}
.css3menu ul a:hover{
color: #141414;
}
.css3menu ul a:active{
color: #ffffff;
}
.css3menu ul li:first-child a{
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.css3menu ul li:first-child a:hover:after{
border-bottom-color: #04acec;
}
.css3menu ul li:last-child a{
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
}
.css3menu:after{
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.mainmenuicondata {
line-height: 16px;
float: left;
padding-right: 10px;
}
.submenuicondata {
line-height: 16px;
float: left;
padding-right: 10px;
}
.mainmenuicondata.icon1 {
padding-right: 18px;
background: url("bottom.png") no-repeat 0 -4px;
background-size: 8px 8px;
background-position: right center;
min-height: 8px;
}
@media screen and (max-width: 682px){
.css3menu a{
display: inline-block;
float: none;
text-align: center;
}
.css3menu {
text-align: center;
}
.css3menu > li{
float: none;
width: 60%;
margin: 0 auto;
}
.css3menu > li:first-child{
margin: 0 auto;
}
}
JQUERY:
(function($) {
$.fn.menumaker = function(options) {
var cssmenu = $(this), settings = $.extend({
title: "Menu",
format: "dropdown",
sticky: false
}, options);
return this.each(function() {
cssmenu.prepend('<div id="menu-button">' + settings.title + '</div>');
$(this).find("#menu-button").on('click', function(){
$(this).toggleClass('menu-opened');
var mainmenu = $(this).next('ul');
if (mainmenu.hasClass('open')) {
mainmenu.hide().removeClass('open');
}
else {
mainmenu.show().addClass('open');
if (settings.format === "dropdown") {
mainmenu.find('ul').show();
}
}
});
cssmenu.find('li ul').parent().addClass('has-sub');
multiTg = function() {
cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
cssmenu.find('.submenu-button').on('click', function() {
$(this).toggleClass('submenu-opened');
if ($(this).siblings('ul').hasClass('open')) {
$(this).siblings('ul').removeClass('open').hide();
}
else {
$(this).siblings('ul').addClass('open').show();
}
});
};
if (settings.format === 'multitoggle') multiTg();
else cssmenu.addClass('dropdown');
if (settings.sticky === true) cssmenu.css('position', 'fixed');
resizeFix = function() {
if ($( window ).width() > 768) {
cssmenu.find('ul').show();
}
if ($(window).width() <= 768) {
cssmenu.find('ul').hide().removeClass('open');
}
};
resizeFix();
return $(window).on('resize', resizeFix);
});
};
})(jQuery);
(function($){
$(document).ready(function(){
$("#cssmenu").menumaker({
title: "Menu",
format: "multitoggle"
});
});
})(jQuery);
最佳答案
查看该站点,它被称为响应能力 :),我查看了 css 代码,这里是它的样子
@media all and (max-width: 768px), 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: 100%;
}
#cssmenu ul,
#cssmenu ul ul,
#cssmenu ul ul ul,
#cssmenu > ul,
#cssmenu.align-center > ul,
#cssmenu > ul > li > ul,
#cssmenu > ul > li:hover > ul, ........
关于jquery - 为什么当菜单完全展开并且我在移动设备上向下滚动时菜单会折叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35932829/
使用 Foundation 6.3.1,我希望在桌面上显示 Canvas 外菜单,在移动设备上显示 Accordion 菜单。例如 This is the desktop view with a co
function HideandUNhideObj(ThisObj) { var nav = document.getElementById(ThisObj).style if (nav.displ
我正在处理一个页面,该页面有一个显示“更新”的链接。当用户单击此链接时,我希望表单使用幻灯片效果并显示在链接下方。提交表单后,它会更新数据库,并且菜单会显示。 我知道这可以用 JavaScript 来
这是我的运行时创建菜单的关键部分: GtkWidget *menu, *menu_item; menu = gtk_menu_new(); menu_item = gtk_image_menu_ite
您好,我想实现一个像这样的 donut 菜单 http://dribbble.com/shots/610433-Wheel-Nav我知道有一种在 css3 中制作 donut 的简单方法。 .doug
我的应用程序中有一个菜单,当菜单打开时我会触发触觉反馈(来自 onTagGesture Action )。 然而 有时当我点击菜单打开触发器时,菜单实际上不会打开,但我仍然收到触觉反馈。我只在菜单实际
也许这是一个简单的解决方案,但我坚持了下来。 这里有我的代码 http://jsbin.com/ejomuv纯CSS菜单 我想要做的是在悬停时在下拉按钮底部设置 0px 边框半径,但仅在下拉菜单上设置
下拉列表、菜单和组合框都是非常常见的用户界面元素。用户习惯于在 native 应用程序和 Web 应用程序中看到这些元素,但它们存在一些问题。 您必须瞄准鼠标。当您将鼠标移开时,有些菜单会折叠,而有些
我有 codeigniter 背景。现在,我正在学习 Laravel。所以,我处于这种情况(示例),我正在尝试创建一个具有多个用户的 web 应用程序。用户类型 A ,他们可以访问菜单 a、菜单 b
我正在学习 JQuery 的基础知识,我的老师显示的 menu() 看起来根本不像我的。 这是我创建的菜单的 LAF: 代码: Hello Hi Welcome World
- SELECT - 上面的显示:none不起作用。我也尝试过“隐藏”,但没有成功。 如何隐藏此选择菜单? 最佳答案 换行与 或并将 id 添加到标签。 - SELECT
我使用 Jquery 创建菜单,如下所示: homeinfo2info3 Jquery 代码如下: $(document).ready(function(){ $(".prof_info1").unb
我是 C 新手,我需要为项目构建一个带有循环的菜单。我有两个问题。 1) 我想在 else 中添加一个字符,如果在主菜单中按“2”后询问某事,问题将是“你要去参加事件吗?”用户可以输入聊天“Y”或“N
大家好,过去几个小时我一直在为类(class)编写这个程序,但似乎无法解决最后两个问题。它基本上是一个略微修改的 CashRegister 类,通过菜单提供基本功能。我遇到的问题是: 1) 用户第一次
List studentInfo = new LinkedList(); int choice; boolean flag = true; Student student =
我正在使用 bootsrap 4 alpha 6 和 midnight.js 来更改导航菜单切换器的颜色。我想在它旁边插入一个文本(菜单)。捕获中的示例。对于文本切换器,我使用 fontawesome
我正在尝试使用 CSS 菜单解决菜单在 IE 6 中无法正确显示的问题 alt text http://content.screencast.com/users/Dokmanc/folders/Jin
我无法让这段代码工作 - 我想要的是当我将鼠标悬停在圆圈上时,菜单会出现,然后如果我将鼠标从圆圈或菜单上移开,它就会消失。我尝试做的任何事情都是非常错误的,例如 onmouseover 在圆圈上然后在
我有一个典型的 CSS 顶部导航,当您滑过不同的父菜单项时,它会显示一个子菜单。如何更改代码以保持显示事件子菜单。因此,如果您在该父菜单项或其子项之一的页面上,它将保持显示该子菜单,除非您将鼠标悬停在
我很亲近。我怎样才能在我的 上有 MENU 1。 fiddle显示为默认菜单选项,然后在 MENU 2 悬停时更改? 提前致谢。继续编码! :) 最佳答案 要根据您的响应完全远离 jquery 进行编
我是一名优秀的程序员,十分优秀!