2.0.0 • Published 5 years ago

@alexisspa9/mobilemenu v2.0.0

Weekly downloads
6
License
ISC
Repository
-
Last release
5 years ago

MenuToggle

install the package

npm install @alexisspa9/mobilemenu

then in your index.js yu can use the package like so:

const menuToggle = require('@alexisspa9/mobilemenu');


menuToggle();

and the html strucure should be

<button data-targetmenu="my-menu">button</button>

<nav data-menu="my-menu" data-toggled="false">
	<ul>
		<li>
			<a href="#">1</a>
			<a href="#">2</a>
			<a href="#">3</a>
			<a href="#">4</a>
			<a href="#">5</a>
		</li>
	</ul>
</nav>

button element should have the data attribute data-targetmenu="yourmenu" and the menu should have the data attribute data-menu="yourmenu". data-targetmenu and data-menu should have the same value in order to open the specific menu. This is reusable with many menus.

2.0.0

5 years ago

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago