1
I’m using the angular along with the ngAnimate. With the ngAnimate it is possible to add some css classes to the element it applies to ng-hide
or ng-show
to apply a transition animation.
I need to run a callback
at the end of an animation ng-show
or ng-hide
. These animations are done through classes I defined in css
.
Example:
<div ng-show="loading" class="animate">Carregando</div>
<div ng-hide="loading" class="animate">Isso aqui só pode mostrar quando a div acima for oculta</div>
That is, when the variable loading
for false
, I need the div #loading
is removed and the #content
is displayed, but only after #loading
is hidden.
The problem I’m having is that the two are active at the same time. I mean, while one is hiding, the other already appears. This causes the screen to jump down and then be normal.
Is there any way to execute a callback
after the end of an animation made with ng-show
or ng-hide
?
Example in JSFIDDLE
You can put a demo https://plnkr.co/ ?
– Gabriel Rodrigues
@Gabrielrodrigues updated
– Wallace Maxters
I get it, why don’t you slow down the
transition: all 1.2s linear;
for0.6
already gives a difference;– Gabriel Rodrigues