Design
The Sidebar Menu can be presented as expanded or collapsed on desktop sizes. And as visible or collapsed on mobile.
The Sidebar Menu is used to structure the core menu for an application.
Code
Example | Element | Code |
---|---|---|
Main content |
Expanded sidebar menu |
|
Main content |
Collapsed sidebar menu |
|
Main content |
Expanded sidebar menu with badges |
|
Main content |
Collapsed sidebar menu with badges |
|
Javascript
Methods
To initialise Sidebar Menus, use the init
method, eg:
$(document).ready(function(){
ACE.SidebarMenu.init();
});
Optional Methods
Function | Arguments | Description | Example |
---|---|---|---|
toggle | jQuery element or selector | Toggle the menu(s) matching the jQuery selector. If they are expanded on the desktop, they will be collapsed; and vice versa. |
|
expand | jQuery element or selector | Expand the menu(s) matching the jQuery selector on the desktop. |
|
collapse | jQuery element or selector | Collapse the menu(s) matching the jQuery selector on desktop and mobile. |
|
toggleMobile | jQuery element or selector | Toggle the menu(s) matching the jQuery selector. If they are visible, they will be collapsed; and vice versa. |
|
showMobile | jQuery element or selector | Show the menu(s) matching the jQuery selector on mobile. |
|
Events
Event | Description | Usage Example |
---|---|---|
ACE.ExpanderPanel.Toggled | Fires when an Expander Panel has been expanded or collapsed. Passes an object with the new state. |
|
ACE.ExpanderPanel.ToggledMobile | Fires when an Expander Panel has been expanded or collapsed. Passes an object with the new state. |
|