Я хочу, чтобы три анимации одного деления выполнялись в разное время, например, когда я нажимаю .exit, ширина изменяется с 400 на 350, после того как маржинальная вершина становится -900px и, наконец, удаляет весь div
<div id="addplanpopup">
<p class="exit">X</p>
<h1>Your plan</h1>
<input class="paperName" placeholder="Enter your plan's head">
</div>
$('#addplanpopup p').click(function(){
$(this).parent().one('transitionend', function() {
$(this).remove();
})
.css({
// this be second animation
'width':'350px'
// and marginTop one be third
'marginTop':'-900px',
})
})
#addplanpopup {
width:400px;
height:700px;
background: red;
left:50%;
top:20%;
transform: translate(-50%,-20%);
transition: .4s;
}