jQuery UI & Menu: Basic menu

This entry is part 1 of 2 in the series jQuery UI Menu

jQuery UI Menu – Default functionality

jQuery UI really makes it easy to design menu items.  Here a menu with the default configuration, disabled items and nested menus.

A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor key to navigate.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Menu - Default functionality</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#menu').menu();
        });
    </script>
    <style>
        .ui-menu {
            width: 150px;
        }
    </style>
</head>
<body>

<ul id='menu'>
    <li class='ui-state-disabled'><a href='#'>Aberdeen</a></li>
    <li><a href='#'>Ada</a></li>
    <li><a href='#'>Adamsville</a></li>
    <li><a href='#'>Addyston</a></li>
    <li>
        <a href='#'>Delphi</a>
        <ul>
            <li class='ui-state-disabled'><a href='#'>Ada</a></li>
            <li><a href='#'>Saarland</a></li>
            <li><a href='#'>Salzburg</a></li>
        </ul>
    </li>
    <li><a href='#'>Saarland</a></li>
    <li>
        <a href='#'>Salzburg</a>
        <ul>
            <li>
                <a href='#'>Delphi</a>
                <ul>
                    <li><a href='#'>Ada</a></li>
                    <li><a href='#'>Saarland</a></li>
                    <li><a href='#'>Salzburg</a></li>
                </ul>
            </li>
            <li>
                <a href='#'>Delphi</a>
                <ul>
                    <li><a href='#'>Ada</a></li>
                    <li><a href='#'>Saarland</a></li>
                    <li><a href='#'>Salzburg</a></li>
                </ul>
            </li>
            <li><a href='#'>Perch</a></li>
        </ul>
    </li>
    <li class='ui-state-disabled'><a href='#'>Amesville</a></li>
</ul>

</body>
</html>
Try The Code

Series Navigation
jQuery UI & Menu: Menu with icons >>