1.0.3 • Published 5 years ago

custom-sidenav-js v1.0.3

Weekly downloads
7
License
ISC
Repository
github
Last release
5 years ago

sidenav

sidenav with animation and touch-support

https://deadlyjack.github.io/sidenav

Installation

install using npm

npm install custom-sidenav-js --save

or use directly in browser

path/to/sidenavjs/CustomSidenav.js

Usage

html

<body>
  <header>
    <button id='toggler'></button>
  </header>
  <section>
    <nav id='sidenav'></nav>
  </section>
</body>

javascript

const opts = {
  sidenav: '#sidenav',
  toggler: '#toggler',
  width: 300,
  backgroundColor: '$cf9'
};
const sidenav = CustomSidenav(opts);

Methods

show()

sidenav.show() //sets sidenav visiblity to on

hide()

sidenav.hide() //sets sidenav visiblity to off

toggle()

sidenav.toggle() //if visiblity is on sets to off else sets to on

Demo

see demo

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago