jQuery UI Menu

Overview

Menu ...

Dependencies

  • jQuery UI Core
  • jQuery UI Widget

Example

Transform a simple list with a few links into a themable menu widget.

$("ul").menu();

<!DOCTYPE html>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  
<link href="http://view.jqueryui.com/menu/themes/base/jquery.ui.menu.css" rel="stylesheet" type="text/css"/>
<script src="http://view.jqueryui.com/menu/ui/jquery.ui.menu.js"></script>

  <script>
  $(document).ready(function() {
    $("ul").menu();
  });
  </script>
</head>
<body style="font-size:62.5%;">
  <ul>
  <li><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="#">Adelphi</a></li>
</ul>
</body>
</html>

Options

Events

Methods

Theming

The jQuery UI Menu plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.menu.css stylesheet that can be modified. These classes are highlighed in bold below.

Sample markup with jQuery UI CSS Framework classes

<ul tabindex="0" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all">
  <li role="menuitem" class="ui-menu-item">
    <a tabindex="-1" class="ui-corner-all" href="#">Text</a>
  </li>
</ul>

Note: This is a sample of markup generated by the menu plugin, not markup you should use to create a menu. The only markup needed for that is <ul>
  <li><a href="#">Text</a></li>
</ul>.