Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lukawski/opnav
- Owner: lukawski
- License: mit
- Created: 2017-03-20T20:25:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T22:29:34.000Z (almost 8 years ago)
- Last Synced: 2024-11-17T20:08:13.991Z (about 2 months ago)
- Topics: html-navigation, javascript, javascript-plugin, navigation, on-page-navigation, opnav, vanilla-js
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()
```
```HTMLContent...
Content...
Content...
Content...
```
### Navigation with one level nesting
```javascript
var menu = new OPNav('section', 'op-nav')
menu.init()
```
```HTMLContent...
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.