Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanety/jquery-simple-menu
https://github.com/kanety/jquery-simple-menu
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kanety/jquery-simple-menu
- Owner: kanety
- License: mit
- Created: 2019-02-17T12:37:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T02:00:45.000Z (almost 4 years ago)
- Last Synced: 2024-12-25T04:04:43.659Z (23 days ago)
- Language: JavaScript
- Size: 42 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-simple-menu
A jquery plugin for simple menu.
## Dependencies
* jquery
## Installation
Install from npm:
$ npm install @kanety/jquery-simple-menu --save
## Basic usage
Build html as follows:
```html
```
Then run:
```javascript
$('#menu').simpleMenu();
```
### Options
Open menu by mouse hovering:
```javascript
$('#menu').simpleMenu({
autoOpen: true
});
```
Keep menu opened after clicking menu items:
```javascript
$('#menu').simpleMenu({
autoOpen: true,
keepOpen: true
});
```
Change to vertical align:
```javascript
$('#menu').simpleMenu({
align: 'vertical'
});
```
### Checkable menu
```javascript
$('#menu').simpleMenu({
checkable: '.checkable-submenu'
}).on('menu:checked', function(e, $li) {
...
}).on('menu:unchecked', function(e, $li) {
...
})
```
### Context menu
```html
```
```javascript
$('#menu').simpleMenu({
context: '#container',
align: 'vertical'
});
```
## Other example
Use button tag instead of a tag:
```html
```
```javascript
$('#menu').simpleMenu();
```
## License
The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).