-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animation finished event [Enhancement] #36
Comments
Hi, that might actually be an interesting enhancement. Anyway I think that with little trickery you can already achieve what you're after and have a smooth effect. If you conditionally apply a class like For example:
<nav mfb-menu class="app-menu" menu-state="menuState"
ng-class="{'fadeOut' : menuState === 'closed'}">
.app-menu{
opacity: 1;
transition: opacity .9s; /* the menu fades IN at this speed */
}
.fadeOut{
opacity: 0.3;
transition: opacity .8s; /* the menu fades OUT this speed */
transition-delay: .5s; /* delay fading out the menu as much as we need*/
} I made a quick Plunkr for this. Hope this helps. |
After re-reading your issue I noticed I probably got your problem mixed up. You don't want to fade the menu, but the content of the page, is that right? Anyway, with little modification with what outlined above you can probably tackle the situation the same way. Updated Plunkr here. Let me know if this is what you're after. |
Thanks for the prompt reply.
Yes, absolutely. (Though I'm open to suggestions)
Too be honest, I'm not too sure - the animation delays are too long for me to discern when the transitions start/end. That plunkr might be doing the right thing in principle, but (for example) when the menu disappears there's an awkward delay before the content unfades (this may just be CSS tweaks) The specific thing I think I want is a) menu open: main body content fades immediately But these are just my specific requirements - I think something along the lines of the onMenuXXXXX events might handle many use-cases. Thanks, and keep up the excellent work. |
With my app the menu frequently appear over content (visually confusing) so my workaround is to fade the main content (
opacity: 20%
, say) while the menu is active viamain-action()
.This works great for the menu open, but ideally I'd like a way to un-fade the content after the menu close animation is complete. Something like an
onAnimationFinished
event, perhaps (though a full suite ofonMenuOpenStart
/onMenuOpenFinished
/onMenuClosedStart
/onMenuClosedFinished
events would be even cooler)Thanks for a great widget.
The text was updated successfully, but these errors were encountered: