Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/lukawski/opnav

Simple on page navigation
https://github.com/lukawski/opnav

html-navigation javascript javascript-plugin navigation on-page-navigation opnav vanilla-js

Last synced: about 2 months ago
JSON representation

Simple on page navigation

Awesome Lists containing this project

README

        

# opNav
Simple on page navigation. It works with every HTML tag and one level nesting.
## Instalation
`npm install op-nav --save`
## Usage
### Simple navigation
```javascript
var menu = new OPNav('section', 'op-nav')
menu.init()
```
```HTML

Content...

Content...

Content...

Content...

```

### Navigation with one level nesting
```javascript
var menu = new OPNav('section', 'op-nav')
menu.init()
```
```HTML

Content...

Content...

Content...

Content...

Content...

```

## Elements
### JavaScript
#### OPNav(**tag**, **menuID**)
1. ```tag``` - HTML tag
2. ```menuID``` - element ID where navigation will be inserted
#### .init()
Creates navigation.

### HTML
#### data-section="true"
Specify if element should be treated as part of navigation.
#### data-label="anyValue"
Label for navigation.
#### data-sub-section="true"
Specify element that is subsection to his parent element.