Как сделать выплывающее меню

272
16 февраля 2018, 17:14

Привет!У меня есть сайт и на нем есть сайдбар и при нажатии на один с блоков должна плавно выежжать вниз меню.Я смотрел как это сделать в интернете но там везде это меню закрывало собой остальные части сайдбара, а мне нужно чтобы оно их сдвигало вниз.Можете посоветовать решение данной задачи?

import React, { Component } from 'react';
import '../App.css';
import FaAngleRight from 'react-icons/lib/fa/angle-right';
class Sidebar extends Component {
    render() {
        return(
        <div className="SidebarMain">
            <div className="Sidebar">
                <ul>
                    <li><span>Top Sales</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Brand Focus</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Hi-Tech</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Cell Phones</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Cameras</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Computers</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>TV.Audio</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Video Games</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Home</span><span className="IconDrop"><FaAngleRight /></span></li>
                    <li><span>Sale</span><span className="IconDrop"><FaAngleRight /></span></li>    
                </ul>        
            </div>
        </div>       
        );
    }
}
export default Sidebar;

СSS

@font-face {
  font-family: 'Montserrat-regular';
  src: url('fonts/Montserrat Regular.eot');
  src: url('fonts/Montserrat Regular.eot?#iefix') format('embedded-opentype'), url('fonts/Montserrat Regular.woff2') format('woff2'), url('fonts/Montserrat Regular.woff') format('woff'), url('fonts/Montserrat Regular.ttf') format('truetype'), url('fonts/Montserrat Regular.svg#Montserrat Regular') format('svg');
  font-weight: 400;
  font-style: normal;
  font-stretch: normal;
  unicode-range: U+0020-2044;
}
@font-face {
  font-family: 'Montserrat-SemiBold';
  src: url('fonts/Montserrat SemiBold.eot');
  src: url('fonts/Montserrat SemiBold.eot?#iefix') format('embedded-opentype'), url('fonts/Montserrat SemiBold.woff2') format('woff2'), url('fonts/Montserrat SemiBold.woff') format('woff'), url('fonts/Montserrat SemiBold.ttf') format('truetype'), url('fonts/Montserrat SemiBold.svg#Montserrat SemiBold') format('svg');
  font-weight: 600;
  font-style: normal;
  font-stretch: normal;
  unicode-range: U+0020-2044;
}
*{
  font-family: 'Montserrat-SemiBold', sans-serif;
}
a {
  text-decoration: none;
}
li {
  text-decoration: none;
  list-style: none;
}
hr {
  border: none;
  background-color: #B9BED1 !important;
  color: #B9BED1 !important;
  height: 1px;
}
input,select {outline:none;}

input:-moz-placeholder {
  color: #999999;
  text-align: center;
  padding-left: 15px;
  font-size: 12px
}
input::-moz-placeholder {
  color: #999999;
  text-align: center;
  padding-left: 15px;
  font-size: 12px
}
input:-ms-input-placeholder {
  color: #999999;
  text-align: center;
  padding-left: 15px;
  font-size: 12px
}
input::-webkit-input-placeholder {
  color: #999999;
  padding-left: 15px;
  font-size: 12px
}
/* ______________________________________________________________________________ШАПКА САЙТА(Header.js) */
.MenuButtons {
  margin-top: 37px;
}
.MenuButtons>li {
  display: inline-block;
}
.MenuButtons>li>a {
  font-size: 14px;
  margin-right: 29px;
  color: #343e5c;
  font-weight: 400;
  font-family: 'Montserrat-SemiBold', sans-serif;
}
.MenuButtons>li>div>span {
  font-size: 15px;
  padding-right: 7px;
}
.MenuButtons>li>img {
  margin-right: 157px;
}
.Cart-container {
  display: inline-block;
  position: relative;
}
.Cart-span {
  display: inline-block;
  background: #ccc;
  color: #000;
  text-align: center;
  border-radius: 50%;
  padding: 50% 0;
  width: 100%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.Cart-text {
  position: relative;
  padding: 0em 0.65em;
}
.CartMain {
  display: inline-block;
  margin-right: 29px;
}
.HeaderMain {
  display: inline;
  color: #343e5c;
  font-family: 'Montserrat-SemiBold', sans-serif;
}
.HeaderBtn {
  font-family: 'Montserrat-SemiBold', sans-serif;
  width: 85px;
  height: 32px;
  border-radius: 16px;
  border: 2px solid #e3e8f0;
  background-color: #fff;
  font-size: 13px;
  color: #343e5c
}
.DropMenu {
  margin-left: 115px;
  font-size: 20px;
}
.MenuHeader {
  margin-right: 75px;
}
@media screen and (max-width:1159px) {
  .MenuButtons>li>img {
    margin-right: 75px;
  }
}
@media screen and (max-width:1073px) {
  .DropMenu {
    margin-left: 35px;
  }
}
@media screen and (max-width:991px) {
  .MenuButtons>li>a {
    margin-right: 15px;
  }
}
@media screen and (max-width:991px) {
  .MenuButtons>li>a {
    display: none;
  }
}
@media screen and (max-width:550px) {
  .MenuHeader {
    margin-right: 25px;
  }
  .MenuButtons>li>img {
    margin-right: 40px;
  }
  .DropMenu {
    margin-left: 5px;
  }
}
@media screen and (max-width:443px) {
  .MenuButtons>li>img {
    display: none;
  }
  .CartMain {
    margin-left: 50px;
  }
}
.SecondMenuMain {
  margin-left: 115px;
  margin-top: 0px;
}
.SecondMenu>li {
  display: inline-block;
}
.SecondMenu>li>a,
.SecondMenu>li>div>input {
  text-decoration: none;
  color: #b9bed1;
  margin-right: 30px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-family: 'Montserrat-SemiBold', sans-serif;
}
.SecondMenu>li>a:hover {
  color: #343e5c;
  font-family: 'Montserrat-SemiBold', sans-serif;
}
.SecondMenu>li>div>input {
  font-family: 'Montserrat-SemiBold', sans-serif;
  border: none;
  margin-left: 13px;
  text-decoration: none;
  color: #b9bed1;
  padding-top: 0px;
}
.SecondMenu>li>div>input:focus {
  border: none;
  text-decoration: none;
}
.Support {
  padding-left: 280px;
}
.Bordered {
  border-left: 1px solid #b9bed1;
  border-right: 1px solid #b9bed1;
}
.Search {
  margin-left: 21px;
}
/* Слайдер,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, */
.carousel-indicators li {
  border-radius: 50%;
  width: 8px !important;
  height: 8px !important;
  background-color: #fff;
}
.carousel-indicators .active {
  background-color: #fefefe;
}
.carousel-control-prev-icon, .carousel-control-next-icon {
  color: #fefefe;

}
.carousel-control-prev-icon{
  padding-left: 183px !important;
}
.carousel-control-next-icon{
  padding-right: 183px !important;
}
.carousel-control-prev:hover {
  color: #fefefe;
}
.carousel{
  height:500px !important;
}
/* ThirdMenu??????????????????????????????????????????????????????????????????????????????????????????????????????? */
.ThirdMenuMain{
  background-color: #e4e5e7;
  padding-top: 50px;
  padding-bottom: 30px;
}
.ThirdMenu{
  margin-left: 100px;
  margin-right: 115px;
}

.ThirdMenu > ul{
  display: inline-flex;
  padding-left: 0px;
}
.ThirdMenu-WhiteBox-1{
  background-color: #fff;
  width: 245px;
  height:56px;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}
.ThirdMenu-WhiteBox-1 > span{
  font-family: 'Montserrat-SemiBold', sans-serif;
  font-size: 11px;
  letter-spacing: 1.1px;
  text-align: left;
  color: #a1a8bd;
  margin-left: 20px;
  margin-right: 49px;
  margin-top: 24px;
  margin-bottom: 23px;
}
.ThirdMenu-WhiteBox-1 > select{
  border: none;
  font-size: 11px;
  font-family: 'Montserrat-SemiBold', sans-serif;
  letter-spacing: 1.1px;
  color: #343e5c;
  width: 107px;
  margin-top: 20px;
  margin-bottom: 24px;
}
.ThirdMenu-WhiteBox-1 > select > option{
  font-size: 11px;
  font-family: 'Montserrat-SemiBold', sans-serif;
  letter-spacing: 1.1px;
  color: #343e5c;
}
.ThirdMenu-WhiteBox-2{
  background-color: #fff;
  width: 693px;
  height: 56px;
  margin-left: 1px;
  margin-top: 0px;
}
.ThirdMenu-WhiteBox-2 > span {
  font-family: 'Montserrat-SemiBold', sans-serif;
  font-size: 11px;
  letter-spacing: 1.1px;
  text-align: left;
  color: #a1a8bd;
  margin-left: 20px;
  margin-right: 12px;
}
.Tablet{
  width: 163px;
  height: 32px;
  border-radius: 16px;
  background-color: #f0f2f7;
  border: solid 1px #e3e8f0;
  margin-top: 12px;
}
.Price{
  width: 64px;
  height: 32px;
  border-radius: 16px;
  background-color: #f0f2f7;
  border: solid 1px #e3e8f0;
}
.Price-{
  margin-left: 6px !important;
  margin-right: 6px !important;
}
.Checbox-ThirdMenu{
  margin-left: 37px;
}
.ThirdMenu-WhiteBox-3{
  background-color: #fff;
  margin-left: 1px;
  height: 56px;
}
.ThirdMenu-WhiteBox-3 > span{
  font-family: 'Montserrat-SemiBold', sans-serif;
  font-size: 11px;
  letter-spacing: 1.1px;
  text-align: left;
  color: #a1a8bd;
  margin-left: 13px;
  margin-right: 12px;
}
.ThirdMenu-WhiteBox-3 > select{
  border: none;
  font-size: 11px;
  font-family: 'Montserrat-SemiBold', sans-serif;
  letter-spacing: 1.1px;
  color: #343e5c;
  width: 50px;
  margin-top: 20px;
  margin-bottom: 24px;
  margin-right: 8px;
  margin-left: 40px;
}
.ThirdMenu-WhiteBox-3 > select > option{
  font-size: 11px;
  font-family: 'Montserrat-SemiBold', sans-serif;
  letter-spacing: 1.1px;
  color: #343e5c;
}
.SidebarMain{
  background-color:#e4e5e7;
}
.Sidebar{
  width: 270px;
  height: 420px;
  border-radius: 5px;
  background-color: #ffffff;
  margin-left: 100px;
}
.Sidebar>ul>li{
  padding-top:5px;
  border-bottom: 1px solid #e4e5e7;
  text-align: left;
}
.Sidebar>ul{
  width: 100%;
  margin: 0px;
  padding: 0px;
}
.Sidebar>ul>li>span:first-child{
  margin-left: 19px;
  font-size: 13px;
  color: #343e5c;
  line-height: 3.23;
}
.Sidebar>ul>li>span:last-child{
  float: right;
  margin-right: 20px;
  font-size: 20px;
  color: #b8bfd3;
}

Полный репозиторий проэкта https://github.com/fpsstyle228/portland.com

READ ALSO
Изменение значения в инпуте через JS

Изменение значения в инпуте через JS

Доброго времени суток, поясните, пожалуйстаИмеется форма

225
Фон страницы в виде диагональных линий

Фон страницы в виде диагональных линий

Для страницы сайта есть фоновая картинка в виде диагональных линийЗадавал ей background-repeat, но тогда стыковка заметна

243