A menu with the default configuration, disabled items and nested menus. This plugin is used to define the behaviour of a menu and of all its menu items.
You'll need bower to install jQuery Menu library and its dependencies
Install the library and save it as a dependency in your project:
$ bower --save install jquery-menuPlease run the following script to initialize a menu with the default options:
$('.menu').menu();You can also specify the following custom options that will overwrite the default ones:
- Type:
Number - Default:
300 - Description: Delay (in milliseconds) of menu item closing
- Type:
String - Default:
sub-menu - Description: CSS class name of any sub menu
- Type:
String - Default:
menu-item - Description: CSS class name of any menu item
- Type:
String - Default:
is-menu-item-visible - Description: CSS class name of the visible menu item
$('.menu').menu({
delay: 500,
subMenuClass: "custom-sub-menu-class"
});The project has the following structure:
dist/
*.min.js // The uglified version of the component.
example/
index.html // jQuery Menu demo page
css/*.css // Demo page's stylesheet
src/
*.js // The source file
tests/
src/*.js // Tests
... // Test runner configuration and test dependencies
...
This project requires node for the development installation so you can install client-side dependencies, build it and test it.
Please run following commands in the project's root directory to install all dependencies:
$ npm install
$ ./node_modules/bower/bin/bower install
$ cd test && npm installHere is a list of grunt tasks => actions mappings, see below for a deeper explanation of the actions.
| Grunt task | jshint | uglify | usebanner | devserver | watch | emptyTheChangelog | conventionalChangelog | changelogCommit |
|---|---|---|---|---|---|---|---|---|
| grunt | * | * | * | |||||
| grunt development | * | * | ||||||
| grunt changelog | * | * | * |
- jshint: Validate files with JSHint.
- uglify: Create the final *.min.js.
- usebanner: Prepends a banner to the minified file
- devserver: Spawns a web server so you can rapidly test your app in action
- watch: Run default task when src or test files are added, changed or deleted.
- emptyTheChangelog: Truncates the CHANGELOG.md file as conventionalChangelog task will append fully regenerated changelog
- conventionalChangelog: Appends Markdown-formatted changelog history to CHANGELOG.md
- changelogCommit: Prepares a new commit with updated CHANGELOG.md and commit message "CHANGELOG.md Updated"
Take a look at test/README.md for more details.
Take a look at CONTRIBUTING.md for more details.