I'm trying to fade away something from the screen, using:
comp.addStyleName("fade-out");
.fade-out {
@include valo-animate-out-fade(2500ms, 1000ms);
}
But as soon as the animation ends, it's back on screen as before. Is there any way to get a callback when the animation is done, so I call remove it. Or maybe there is a way to do it in pure SCSS?
I also see that once the animation ran a can't run it again (by removing and adding back style). Is this expected behavior?
EDIT: The second issue was because I remove and add the styles in a listener one after the other. The client will not notice that anything changed, so will not animate. This is corrected by using server pushing, so the removal and new apply is in separate communications.
EDIT 2: Using push I can remove it by spawning a thread, sleeping for the time of the animation and removing. It works, but sounds really ugly. Any better way?
addStyleName()
or so? – KaminskyaddStyleName("fade-out")
. – RedaddStyleName()
without reset & lock. But I have something else that I have working already. Not sure if I can add a callback to it. If iI remeber correct it involvedjQuery
also... – Kaminsky