I have a sidebar with a list inside it. When I click on a button, the sidebar elements disappear with a fade out and the sidebar width decrease with an animation.
I need to wait the sidebar elements disappearing before decrease the sidebar width.
How can I wait an animation before start another using AngularJS ?
EDIT
Here a fiddle of what I have : https://jsfiddle.net/Booggi/65s7Lvxr/
Here my sidebar :
<div class="sidebar" id="sidebar">
<div class="list-group">
<a href="#" class="list-group-item">Library</a>
<a href="#" class="list-group-item">Stats</a>
<a href="#" class="list-group-item">History</a>
</div>
</div>
The CSS:
body, html {
height: 100%;
}
.sidebar {
float: left;
width: 150px;
height: 100%;
margin-right: 10px;
padding-top: 50px;
background: #3F3F3F;
transition: width 0.3s ease;
overflow: hidden;
}
@media (max-width: 764px) {
.sidebar {
width: 10px;
}
.sidebar .list-group .list-group-item {
display: none;
}
}
.sidebar-toggle {
width: 10px;
}
.sidebar .list-group .list-group-item {
border-radius: 0;
border: none;
background: #AFAFAF;
}
.sidebar .list-group .list-group-item:not(:last-child) {
margin-bottom: 1px;
}
.sidebar-toggle .list-group .list-group-item {
display: none;
}
I want to remove the sidebar list with a fadeout and after that, collapse my sidebar.
When I toggle the sidebar, I uncollapse it and AFTER this animation, display my list.
Thanks!