| layout | post |
|---|---|
| title | Center-Menu |
| description | center menu |
| platform | js |
| control | Menu |
| documentation | ug |
| api | /api/js/ejmenu |
You can align the Menu items to center by setting “enableCenterAlign” property as true. enableCenterAlign property accepts Boolean value. By default, its value is false. When set to true, then the root menu items is aligned in center.
Add the following code in your <script> section.
{% highlight html %}
{% endhighlight %}
{% highlight javascript %}
jQuery(function ($) {
$("#menu").ejMenu({
width: 500,
enableCenterAlign: true
});
});
{% endhighlight %}
The following screenshot displays the output of the above code.
