Rocket Menu
A Javascript menu module.
Getting Started
Install via NPM.
npm install rocket-menu
NOTE that this module has a dependency Rocket Tools (28kb) which will automatically be installed as well.
Start by including the necessary files.
/* Your content goes here */
HTML Example
There are two different menu types and all use the same HTML. You require the trigger that will open the menu and the actual menu list. See an example below.
Open Menu Menu Link One Link Two Link Three Link Four Link Five
Initialization
Use the following example to trigger the menu module.
Rocket;
Options
Name | Default | Options | Description |
---|---|---|---|
closeText |
close |
You can decide what you want the close text to say. | |
reveal |
left |
left right |
Set the direction from which the menu appears. NOTE that this only applies to the slide menu. |
target |
Set the menu that you want to open. | ||
trigger |
Set the elements that will trigger the menu. | ||
type |
slide |
mini slide |
This determines the type of menu you want to use. |
Methods
You can also manually execute certain methods once the menu has been initialised.
// Initialize a menuconst menu = Rocket; // Show the menumenu; // Close the menu;
Defaults
You can also overwrite the module options globally by altering the defaults. To do so reference the defaults object property. For example:
RocketdefaultsmenucloseText = 'Cancel';
Author
Created and maintained by Chris Humboldt
Website: chrishumboldt.com
Twitter: twitter.com/chrishumboldt
GitHub github.com/chrishumboldt
Copyright and License
Copyright 2018 Rocket Project
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.