Skip to content
Browse files

Menu: Adding a demo showing how to create category headers

Closes gh-1347
  • Loading branch information...
tjvantoll committed Sep 19, 2014
1 parent da02b2e commit 1c08e882ab7d4be90c2f08a3876f34141ab478c8
Showing with 43 additions and 0 deletions.
  1. +42 −0 demos/menu/categories.html
  2. +1 −0 demos/menu/index.html
@@ -0,0 +1,42 @@
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>jQuery UI Menu - Categories</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/position.js"></script>
<script src="../../ui/menu.js"></script>
<link rel="stylesheet" href="../demos.css">
$(function() {
$( "#menu" ).menu({
items: "> :not(.ui-widget-header)"
.ui-menu { width: 200px; }
.ui-widget-header { padding: 0.2em; }

<ul id="menu">
<li class="ui-widget-header">Category 1</li>
<li>Option 1</li>
<li>Option 2</li>
<li>Option 3</li>
<li class="ui-widget-header">Category 2</li>
<li>Option 4</li>
<li>Option 5</li>
<li>Option 6</li>

<div class="demo-description">
<p>By using the <code>items</code> option, you can configure which elements are converted into selectable menu items. Here this technique is used to create category headers.</p>
@@ -10,6 +10,7 @@
<li><a href="default.html">Default functionality</a></li>
<li><a href="icons.html">Icons</a></li>
<li><a href="categories.html">Categories</a></li>


0 comments on commit 1c08e88

Please sign in to comment.
You can’t perform that action at this time.