6

I'm trying to create a custom behaviour to mmenu to open from the right side of the website.

There is any guide on how to change such thing? Here is what I got so far.

http://codepen.io/davo/pen/krxLw

Anyway, I'll keep working on this, if I find a proper way, I'll post it here.

pixelbeat
  • 95
  • 1
  • 6

2 Answers2

2

Set the option "position" to "right" ("direction" isn't an option):

$("nav").mmenu({
    offCanvas {
        position: "right"
    }
});

The documentation for the plugin comes with the download pack, just open the docs/index.html file for examples, the options, the events and a tutorial. All of this is also accessible via the website (click the "check out these pages" links).

EDIT: Plugin is now properly documented: http://mmenu.frebsite.nl

Fred
  • 512
  • 3
  • 6
  • 1
    Unfortunately, this is not working. {position:'right'} still slides the menu left - right. Anything I've tried doesn't change the behavior. Can you please provide an example that does this, since it's a feature that others may need as well? Thanks. – IIS7 Rewrite Mar 03 '15 at 19:18
  • @IIS7Rewrite the solution would be to use it within the `offCanvas` object. See [this](http://mmenu.frebsite.nl/documentation/extensions/positioning.html) for more details. – RPL Feb 13 '16 at 04:32
1

You can set the option position. Default it is left but if you set it to right your menu slides open from the right. Add direction:'right' so it opens to the left.

$menu.mmenu({
    dragOpen: true,
    position:'right',
    direction:'left',
    ...
});

And no, there doesn't really seem to be documentation about this plugin. I have just downloaded the source code and had a look how it all works. That's how I found out.

Hope it helps.

putvande
  • 15,068
  • 3
  • 34
  • 50
  • It helped, thanks. Actually I had to change some parts of the CSS on the mmenu.css. #header a, .header a { display: block; width: 40px; height: 40px; position: absolute; top: 0; right: 10px; } – pixelbeat Aug 04 '13 at 20:14
  • 1
    Shame this question is closed; it's definitely relevant. Anyhow, there's now a plug-in to handle positioning: http://mmenu.frebsite.nl/documentation/extensions/positioning.html. – Dan May 31 '15 at 10:16
  • ^ Not a plugin, but an extension of the plugin itself – RPL Feb 13 '16 at 04:30