How to hide open drawer in material design lite

I have a set of links inside a box. Like the navigation example here:

http://www.getmdl.io/components/index.html#layout-section/layout

The only difference is that my links do not refresh the page (this is a one-page application built using the trunk). How to close the box after clicking the link?

+4
source share
1 answer

It looks like there is a .is-visible class on the box, and by deleting it, the box is hidden. So (using jquery) something like this switches the box:

$(".mdl-layout__drawer").toggleClass("is-visible")

So I need to add this to the event handler for links or put it in the onClick attribute.

+2
source

Source: https://habr.com/ru/post/1599554/


All Articles