1.0.3 • Published 7 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 --saveor use directly in browser
path/to/sidenavjs/CustomSidenav.jsUsage
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 onhide()
sidenav.hide() //sets sidenav visiblity to offtoggle()
sidenav.toggle() //if visiblity is on sets to off else sets to onDemo
see demo