javascript - Toggle-only sidenav with Angular-Material? -
i want side menu closed default on screen size, , open on top of other content. no matter seek though, switches @ widths on 960px.
this menu looks now:
<md-sidenav is-locked-open="false" class="md-sidenav-right md-whiteframe-z2" component-id="right"> <md-toolbar class="md-theme-dark"> <div class="md-toolbar-tools"> <md-button ng-click="togglemenu()" class="md-button-colored"><core-icon icon="polymer"></core-icon></md-button> <span flex></span> </div> </md-toolbar> <md-content class="md-content-padding"> <md-button ng-click="togglemenu()" class="md-button-colored">stuff</md-button> </md-content> </md-sidenav>
and controller:
.controller('homectrl', function ($scope, $mdsidenav) { $scope.togglemenu = function() { $mdsidenav('right').toggle(); }; })
i got is-locked-open website can't find anywhere in javascript.
you can utilize is-locked-open attribute in md-sidenav command locking open of sidenav. lock sidenav when browser width 1000px.
<md-sidenav is-locked-open="$media('min-width: 1000px')"></md-sidenav>
to have forever unlocked, worked me:
<md-sidenav is-locked-open="$media('')"></md-sidenav>
javascript angularjs
No comments:
Post a Comment