jquery-ui/demos/menu/categories.html
TJ VanToll de2ef2a585 Menu: Wrap menu items in a <div>
This avoids styling issues where ui-state-focus rules apply to submenus.

Fixes #10162
Closes gh-1342
2014-10-25 10:10:30 -07:00

43 lines
1.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<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">
<script>
$(function() {
$( "#menu" ).menu({
items: "> :not(.ui-widget-header)"
});
});
</script>
<style>
.ui-menu { width: 200px; }
.ui-widget-header { padding: 0.2em; }
</style>
</head>
<body>
<ul id="menu">
<li class="ui-widget-header"><div>Category 1</div></li>
<li><div>Option 1</div></li>
<li><div>Option 2</div></li>
<li><div>Option 3</div></li>
<li class="ui-widget-header"><div>Category 2</div></li>
<li><div>Option 4</div></li>
<li><div>Option 5</div></li>
<li><div>Option 6</div></li>
</ul>
<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>
</div>
</body>
</html>