After the plugin has been fired, a series of custom events are available for the menu. The open
and close
events come in an infinitive, a participle and a past participle form.
The infinitive (e.g. open
) can be triggered for controlling the menu manually, the participle (e.g. opening
) is triggered when the action is actually executed and the past participle (e.g. opened
) is triggered on the completion of the action.
All custom events are bound to the .mm
-namespace, so triggering (or binding a new function to) an event would best be done like this:
$("#my-menu").trigger( "open.mm" ); $("#my-menu").on( "opening.mm", function() { alert( "The menu will now be opened." ); } ); $("#my-menu").on( "opened.mm", function() { alert( "The menu has just been opened." ); } );
Click the menu-button in the header to open the menu and have a look at all the events.