I am using md-sidenav from Material Design in angularjs.
Question : Is it possible to disable animation of md-sidenav when it opens and closes? It seems its opening and closing are animated by default.
<md-sidenav md-component-id="left" class="md-sidenav-left">
Left Nav!
</md-sidenav>
Try add the attribute md-no-ink to the sidevav
<md-sidenav md-no-ink md-component-id="left" class="md-sidenav-left">
Left Nav!
</md-sidenav>
Or remove all animations overriding the CSS:
.md-ripple-container, .md-ripple-placed {
transition: none;
}
reference: https://groups.google.com/d/topic/ngmaterial/HJ01ZHEbOQA/discussion
I generate a disable-animations.css
with next:
* {
-webkit-transition: none !important;
transition: none !important;
}
I include this file at the end of all.
If you need disable specific controls, use:
disable-animation,
disable-animation *,
.disable-animation,
.disable-animation * {
-webkit-transition: none !important;
transition: none !important;
}
This CSS worked for me. I looked through the AngularMaterial CSS file and removed all references to animations. KA-BOOM!
/**
* fix md-sidenav lag by removing animation
**/
.md-sidenav-backdrop {
opacity: 0 !important;
}
md-sidenav.md-closed-add,
md-sidenav.md-closed-remove,
md-sidenav.md-closed-add.md-closed-add-active,
md-sidenav.md-closed-remove.md-closed-remove-active,
md-sidenav.md-locked-open-remove-active,
md-sidenav.md-closed.md-locked-open-add-active
{
-webkit-transition: none !important;
transition: none !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With