我在這裏有以下網站:http://ideedev.co.uk/newseed/和問題是在移動模式,當漢堡菜單出現。添加關閉按鈕到移動導航
您會看到我已將漢堡包圖標定位在標題條的中央,但這會出現問題,因爲當我打開移動菜單時,漢堡包圖標滑出,我無法點擊它關閉菜單再次。
我最初的想法是讓菜單從頂部滑入,但我不確定如何實現這一點,所以我的下一個想法是隻需在移動設備的某個位置簡單地使用「關閉」X或甚至單詞CLOSE菜單這將使菜單背面滑出......
從我所看到的,我的CSS是在這裏:
/* NAVIGATION
========================================================================== */
/* Body Class - slides the webpage to the left to allow the nav menu to appear */
.page-slide {
overflow-x: hidden;
position: relative;
right: 0;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
.page-slide-out {
right: 70%;
overflow: hidden;
position: fixed;
/*top: 0;*/
min-width: 100%;
height: 100%;
}
@media (min-width: 500px) and (max-width: 68.75em) {
.page-slide-out {
right: 350px;
}
}
@media (min-width: 68.75em) {
.page-slide-out {
right: 0;
}
}
#nav__menu-pos {
/*float: right;*/
}
.nav {
/* Hamburger Icon */
/* Navigation Menu */
/* Navigation links */
}
.nav__menu {
cursor: pointer;
width: auto;
height: auto;
margin-top: 19px;
margin-left: auto !important;
margin-right: auto !important;
}
@media (max-width: 1100px) {
.nav__menu {
margin-top: 32px;
}
}
.nav__menu_line {
display: block;
width: 30px;
height: 4px;
background: #FFF;
margin-bottom: 10px;
margin-left: auto;
margin-right: auto;
-webkit-transition: all 200ms linear;
transition: all 200ms linear;
}
@media (min-width: 68.75em) {
.nav__menu {
display: none;
margin-top: 32px;
}
}
.nav__bar {
margin-left: 205px;
background-color: #262625;
position: fixed;
color: #FFF;
top: 0;
right: 0;
width: 70%;
height: 100%;
font-weight: bold;
text-transform: uppercase;
text-align: center;
z-index: 100;
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
.nav__bar.nav--pushed-open {
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
.nav__bar ul {
margin-top: 6%;
}
@media (min-width: 68.75em) {
.nav__bar ul {
margin-top: 0;
}
}
.menu-item {
cursor: pointer;
-webkit-transition: all 0.3s linear;
transition: all 0.3s linear;
/* Navigation Menu Media Query */
}
.menu-item a {
display: block;
padding: 8% 0;
}
.menu-item:hover {
background-color: #A2C663;
}
@media (min-width: 68.75em) {
.menu-item {
float: left;
border-top: 5px solid transparent;
font-size: 14px;
}
.menu-item a {
padding: 39px 15px 0 15px;
}
.menu-item:hover {
border-color: #f4f18e;
background-color: transparent;
}
}
@media (max-width: 1099px) {
.nav__bar {
max-width: 350px;
}
}
@media (min-width: 68.75em) {
.nav__bar {
position: static;
background-color: transparent;
width: auto;
transform: translateX(0);
-webkit-transform: translateX(0);
transition: all 0s;
}
}
所以,我想我要麼想了解如何將其滑入從頂部或打開時如何在菜單內添加關閉按鈕?
現在選擇這個,直到我有空閒時間嘗試其他選項:)謝謝! –