Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable animation for md-sidenav in angularjs

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>
like image 497
Sunil Avatar asked May 24 '15 01:05

Sunil


3 Answers

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

like image 121
Diego Lins de Freitas Avatar answered Nov 19 '22 21:11

Diego Lins de Freitas


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;
}
like image 39
Eduardo Cuomo Avatar answered Nov 19 '22 23:11

Eduardo Cuomo


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;
}
like image 1
David Avatar answered Nov 19 '22 22:11

David