When I click on the toggle my bar appears as I wish but it does not slide from left to right it just appears, I would like it to be displayed as the following snippet but I can not make it slide apparently I have to declare the width in vw, this question had already been answered in the following link but I can not fix it apparently it's the styles, I have the width in vw
but I do not know what could be wrong, they could help me.
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
* {
margin: 0;
padding: 0;
}
#wrapper {
width: 100vw;
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 250px;
}
#sidebar-wrapper {
z-index: 1000;
position: fixed;
left: 250px;
width: 0;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #050545;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
box-shadow: inset -10px 0px 10px -7px grey;
}
#wrapper.toggled #sidebar-wrapper {
width: 250px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<div id="wrapper" style="background-color:red">
<div id="sidebar-wrapper" style="background-color:yellow">sidebar
<div id="result"></div>
</div>
<div id="header" class="container-fluid">
<div class="navbar"> <a href="#menu-toggle" id="menu-toggle">Press</a>
<div>This is a serious health setback for me personally, but one of CN's core strengths is that we have a very experienced and tightly-knit senior <span id="counterId"></span>
</div>
</div>
</div>
</div>
these are my components SideBar.js
const className = menuVisible ? 'flyoutMenu show' : 'flyoutMenu hide';
return(<div onMouseDown={this.props.controlarApuntador} className={className} >
<div className='menu-lateral'>
<img src="images/borealis.jpg"
size="mini" style={borealis} />
<h2><a href='#'><span>A</span>cerca</a></h2>
<hr></hr>
<h2><a href='#'><span>C</span>ontacto</a></h2>
<hr></hr>
<div style={{ paddingTop: '10px'}}>
<hr></hr>
</div>
<div style={{ paddingTop: '10px'}}>
<iframe src="https://open.spotify.com/embed/user/emeery/playlist/5ZUCEmqNDcx4HhVaMAgliO"
width="300" height="87" frameBorder="0" allowTransparency="true"></iframe>
</div>
</div>
</div>);
and my styles.css
.flyoutMenu {
width: 50vw;
height: 100vh;
background-color: #FFE600;
position: fixed;
top: 0;
left: 0;
transition: transform .3s
cubic-bezier(0, .52, 0, 1);
overflow: scroll;
z-index: 1000;
}
.flyoutMenu.hide {
transform: translate3d(-100vw, 0, 0);
}
.flyoutMenu.show {
transform: translate3d(0vw, 0, 0);
overflow: hidden;
color: white;
border-color:salmon;
border-width:1px;
border-style:solid;
background-color: rgba(255, 255, 255, 0.589);
width: 60vw;
transition: transform 0.3s ease-in-out;
border-radius:5px;
} // flyoutMenu.show