Browse files

Menu: Remove stupid demos, add an icons demo, improve the default demo

  • Loading branch information...
1 parent f4b3cd5 commit 568aec62d977af89a5a1aa0f9dbf1301b8df0ea0 @jzaefferer jzaefferer committed Oct 23, 2012
Showing with 86 additions and 179 deletions.
  1. +41 −16 demos/menu/default.html
  2. +44 −0 demos/menu/icons.html
  3. +1 −2 demos/menu/index.html
  4. +0 −74 demos/menu/navigationmenu.html
  5. +0 −87 demos/menu/topalignmenu.html
View
57 demos/menu/default.html
@@ -7,36 +7,61 @@
<script src="../../jquery-1.8.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
+ <script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#menu" ).menu();
});
</script>
+ <style>
+ .ui-menu { width: 150px; }
+ </style>
</head>
<body>
<ul id="menu">
- <li><a href="#Aberdeen">Aberdeen</a></li>
- <li><a href="#Ada">Ada</a></li>
- <li><a href="#Adamsville">Adamsville</a></li>
- <li><a href="#Addyston">Addyston</a></li>
- <li><a href="#Adelphi">Adelphi</a></li>
- <li><a href="#Adena">Adena</a></li>
- <li><a href="#Adrian">Adrian</a></li>
- <li><a href="#Akron">Akron</a></li>
- <li><a href="#Albany">Albany</a></li>
- <li><a href="#Alexandria">Alexandria</a></li>
- <li><a href="#Alger">Alger</a></li>
- <li><a href="#Alledonia">Alledonia</a></li>
- <li><a href="#Alliance">Alliance</a></li>
- <li><a href="#Alpha">Alpha</a></li>
- <li><a href="#Alvada">Alvada</a></li>
+ <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>
<div class="demo-description">
-<p>A menu with the default configuration. A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor keys to navigate.</p>
+<p>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 keys to navigate.</p>
</div>
</body>
</html>
View
44 demos/menu/icons.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Menu - Icons</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+ <script src="../../jquery-1.8.2.js"></script>
+ <script src="../../ui/jquery.ui.core.js"></script>
+ <script src="../../ui/jquery.ui.widget.js"></script>
+ <script src="../../ui/jquery.ui.position.js"></script>
+ <script src="../../ui/jquery.ui.menu.js"></script>
+ <link rel="stylesheet" href="../demos.css">
+ <script>
+ $(function() {
+ $( "#menu" ).menu();
+ });
+ </script>
+ <style>
+ .ui-menu { width: 150px; }
+ </style>
+</head>
+<body>
+
+<ul id="menu">
+ <li><a href="#"><span class="ui-icon ui-icon-disk"></span>Save</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-zoomin"></span>Zoom In</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-zoomout"></span>Zoom Out</a></li>
+ <li class="ui-state-disabled"><a href="#"><span class="ui-icon ui-icon-print"></span>Print...</a></li>
+ <li>
+ <a href="#">Playback</a>
+ <ul>
+ <li><a href="#"><span class="ui-icon ui-icon-seek-first"></span>Prev</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-stop"></span>Stop</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-play"></span>Play</a></li>
+ <li><a href="#"><span class="ui-icon ui-icon-seek-end"></span>Next</a></li>
+ </ul>
+ </li>
+</ul>
+
+<div class="demo-description">
+<p>A menu with the default configuration, showing how to use a menu with icons.</p>
+</div>
+</body>
+</html>
View
3 demos/menu/index.html
@@ -8,8 +8,7 @@
<ul>
<li><a href="default.html">Default functionality</a></li>
- <li><a href="topalignmenu.html">Top-aligned sub menus</a></li>
- <li><a href="navigationmenu.html">Navigation menu</a></li>
+ <li><a href="icons.html">Icons</a></li>
</ul>
</body>
View
74 demos/menu/navigationmenu.html
@@ -1,74 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Menu - Navigation Menu</title>
- <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
- <script src="../../jquery-1.8.2.js"></script>
- <script src="../../ui/jquery.ui.core.js"></script>
- <script src="../../ui/jquery.ui.widget.js"></script>
- <script src="../../ui/jquery.ui.position.js"></script>
- <script src="../../ui/jquery.ui.menu.js"></script>
- <link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
- $( "#menu" ).menu({
- select: function( event, ui ) {
- var link = ui.item.children( "a:first" );
- if ( link.attr( "target" ) || event.metaKey || event.shiftKey || event.ctrlKey ) {
- return;
- }
- location.href = link.attr( "href" );
- }
- });
- });
- </script>
- <style>
- .ui-menu { width: 200px; margin-bottom: 2em; }
- </style>
-</head>
-<body>
-
-<ul id="menu">
- <li><a href="?Aberdeen">Aberdeen</a></li>
- <li><a href="?Ada">Ada</a></li>
- <li><a href="?Adamsville">Adamsville</a></li>
- <li><a href="?Addyston">Addyston</a></li>
- <li>
- <a href="?Delphi">Delphi</a>
- <ul>
- <li><a href="?Ada">Ada</a></li>
- <li><a href="?Saarland">Saarland</a></li>
- <li><a href="?Salzburg">Salzburg</a></li>
- </ul>
- </li>
- <li><a href="?Saarland">Saarland</a></li>
- <li>
- <a href="?Salzburg">Salzburg</a>
- <ul>
- <li>
- <a href="?Delphi">Delphi</a>
- <ul>
- <li><a href="?Ada">Ada</a></li>
- <li><a href="?Saarland">Saarland</a></li>
- <li><a href="?Salzburg">Salzburg</a></li>
- </ul>
- </li>
- <li>
- <a href="?Delphi">Delphi</a>
- <ul>
- <li><a href="?Ada">Ada</a></li>
- <li><a href="?Saarland">Saarland</a></li>
- <li><a href="?Salzburg">Salzburg</a></li>
- </ul>
- </li>
- <li><a href="?Perch">Perch</a></li>
- </ul>
- </li>
-</ul>
-
-<div class="demo-description">
-<p>A navigation menu. A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor keys to navigate.</p>
-</div>
-</body>
-</html>
View
87 demos/menu/topalignmenu.html
@@ -1,87 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Menu Demo: Top-aligned Menu</title>
- <link rel="stylesheet" href="../demos.css">
- <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
- <script src="../../jquery-1.8.2.js"></script>
- <script src="../../ui/jquery.ui.core.js"></script>
- <script src="../../ui/jquery.ui.widget.js"></script>
- <script src="../../ui/jquery.ui.position.js"></script>
- <script src="../../ui/jquery.ui.menu.js"></script>
- <script>
- $(function() {
- $( "#menu" ).menu({
- position: { of: "ul:has(a.ui-state-focus):last" },
- icons: {
- submenu: "ui-icon-carat-1-e"
- }
- });
- });
- </script>
- <style>
- .ui-menu { width: 200px; margin-bottom: 2em; }
- </style>
-</head>
-<body>
-
-<ul id="menu">
- <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="#">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="#">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="#">Adamsville</a>
- <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="#">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="#">Saarland</a></li>
- </ul>
- </li>
- <li><a href="#">Perch</a>
- <ul>
- <li><a href="#">Addyston</a></li>
- <li><a href="#">Delphi</a></li>
- <li><a href="#">Perch</a></li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-
-<div class="demo-description">
-<p>Menus can use custom positioning. There is a delay before activing an item on hover and a delay before closing a menu on mouse out to allow for moving to a submenu that is not touching its parent item.</p>
-</div>
-</body>
-</html>

0 comments on commit 568aec6

Please sign in to comment.