Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanety/jquery-simple-menu


https://github.com/kanety/jquery-simple-menu

Last synced: 8 days ago
JSON representation

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).