Materialize.css swipe right to open menu


#1

I know Materialize.css has a swipe left to dismiss the open sidemenu option but is an implementation available for opening the menu on swiping right as found in most android phones. I have a meteorjs implementation for a android app. On the website http://materializecss.com/mobile.html seems to offer the option but how can it be implemented. Could anyone please give some example code explaining how to implement this feature or maybe a tutorial/resources.

Thanks!


#2

I’m not sure specifically what you mean, but if what you desire is to have the menu open/close from the right side then it’s just an option passed to the initialization method.

Template.templateName.onRendered(function() {
    this.$(".activatorSelector").sideNav({
        menuWidth: 300,
        edge: 'right', //<-----Specify menu position here
        closeOnClick: true
    });
});

#3

@copleykj Thanks for the reply mate! I meant that on materialize to open the side menu we have to click on the menu icon. Polymer includes an option by default to swipe right on the phone to open the side nav without clicking the icon https://github.com/HedCET/torrent_watch.

Right now the close on click option allows me for left swiping to close the menu. I meant how can I enable a right swipe on the android device to open the sidenav.


#4

Sliding from the left edge to the right to open the menu works perfectly for me on mobile. Also sliding to close works as well.