A small jQuery plugin that creates a menu list from elements with the data-menu
attribute.
Several quick start options are available:
- Download the latest release.
- Clone the repo:
git clone https://github.com/PartBerlin/jquery-menu-builder.git
.
Include script after jQuery (unless you are packaging scripts somehow else):
<script src="/path/to/menu-builder.js"></script>
The plugin can also be loaded as AMD or Node module.
<!DOCTYPE html>
<html>
<head>
<title>jquery-menu-builder Demo</title>
</head>
<body>
<h1 data-menu>Headline 1</h1>
<h2 data-menu="Custom Headline 1-1">Headline 1-1</h2>
<h2 data-menu>Headline 1-2</h2>
<div id="menu"></div>
<script src="path_to/jquery.js"></script>
<script src="path_to/menu-builder.js"></script>
<script>
$('#menu').menuBuilder();
</script>
</body>
</html>
This will change the element #menu
the following way.
<div id="menu">
<ul>
<li>1 - Headline 1</li>
<li>2 - Custom Headline 1-1</li>
<li>3 - Headline 1-2</li>
</ul>
</div>
Please see CHANGELOG for more information on what has changed recently.
$ grunt test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email info@part-online.de instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.