I would like to know how to invert the element transition effect with CSS3
$('span').on('click', function(){
if($(this).text() == 'Mostrar Efeito')
{
$('div').css('max-height', '250px');
$(this).text('Resetar');
}
else
{
$('div').css('max-height', '0');
$(this).text('Mostrar Efeito');
}
});
div{
background-color: coral;
width: 200px;
height: 250px;
max-height: 0;
transition: 0.5s;
}
span{
cursor: pointer;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span>Mostrar Efeito</span>
<div></div>
Notice that in this small example I created the effect starts from the top and goes down. I wonder how I can reverse this effect from the bottom up. I tried to find something similar on the Internet but without success (I think for lack of being able to format the doubt correctly).