1.0.3 • Published 5 years ago
custom-sidenav-js v1.0.3
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