Skip to content

PartBerlin/jquery-menu-builder

Repository files navigation

jquery-menu-builder

Software License Build Status

A small jQuery plugin that creates a menu list from elements with the data-menu attribute.

Install

Several quick start options are available:

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.

Usage

<!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>

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ grunt test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email info@part-online.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A small jQuery plugin that creates a menu list from elements with the data-menu attribute

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published