DanL DanL - 4 years ago 417
Javascript Question

mmenu position & direction attributes to slide in from right

I read another person's question asking how to make mmenu slide in from the right side of the screen instead of the left. They responded saying that they got it to work by doing the following, but it does not work in my instance - it still moves in from the left side of the screen, not the right like I want.

The mmenu related files are the latest from http://mmenu.frebsite.nl/, so I do not believe it's a version issue.

<!DOCTYPE html>
<title>mmenu test</title>
<script src="jquery-2.1.4.min.js"></script>
<link type="text/css" href="jquery.mmenu.all.css" rel="stylesheet" />
<script type="text/javascript" src="jquery.mmenu.min.all.js"></script>
$(document).ready(function() {
var API = $("#menu").mmenu({
dragOpen: true,
}).data( "mmenu" );
$("#menu-button").click(function() {
This is some body content
<button id="menu-button">open/close</button>

<nav id="menu">
<li><a href="/">Home</a></li>
<li><a href="/about">About us</a>

Answer Source

From this page of the plugin documentation, you need to include the "positioning" extension. I guess it is already included in your case, because you call the all.js and all.css files.

Then, use the following code :

   offCanvas: {
      position: "right"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download