jquery-ui/tests/visual/menu/menu.html

305 lines
6.9 KiB
HTML
Raw Normal View History

2010-03-20 20:51:53 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
2010-03-20 20:51:53 +00:00
<title>Menu Visual Test: Default</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>
2012-05-18 14:40:44 +00:00
<script>
2010-03-20 20:51:53 +00:00
$(function() {
2012-05-18 14:40:44 +00:00
function logger( event, ui ) {
$( "<p>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" );
}
$( "#menu1, #menu3, .menu4" ).menu({
select: logger
});
$( "#menu2" ).menu({
position: {
my: "left top",
at: "left+10 top-20"
},
2012-05-18 14:40:44 +00:00
select: logger
});
2012-05-18 14:40:44 +00:00
$( "#menu5" ).menu({
menus: "div",
select: logger
});
2010-03-20 20:51:53 +00:00
2012-05-18 14:40:44 +00:00
$( "#menu6" ).menu({
menus: ".menuElement",
select: logger,
icon: "ui-icon-carat-1-s"
});
$( "#menu7" ).menu({
items: "> :not('.ui-menu-group')",
select: logger
});
2010-03-20 20:51:53 +00:00
});
</script>
<style>
body { font-size:62.5%; }
2011-03-11 16:23:15 +00:00
.ui-menu { width: 200px; margin-bottom: 2em; }
.menu2-container { width: 220px; }
.menu4 { height: 225px; overflow-y: auto; overflow-x: hidden; }
.address-item { border-bottom: 1px solid #999; }
.address-header { display: block; margin-bottom: .2em; font-weight: bold; }
.address-content { display: block; margin-bottom: .2em; padding-left: 10px; }
2010-03-20 20:51:53 +00:00
</style>
</head>
<body>
<h2>Default inline menu</h2>
<ul id="menu1">
<li>Aberdeen</li>
<li>Ada</li>
<li>Adamsville</li>
<li>Addyston</li>
<li>Delphi</li>
<li>Saarland</li>
<li>Salzburg</li>
2010-03-20 20:51:53 +00:00
</ul>
<h2>Inline with disabled items and submenus</h2>
2011-04-20 15:18:15 +00:00
<ul id="menu2">
<li class="ui-state-disabled">Aberdeen</li>
<li>Ada</li>
<li>Adamsville</li>
<li>Addyston</li>
<li>Delphi
<ul>
<li class="ui-state-disabled">Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
</ul>
</li>
<li>Saarland</li>
<li>Salzburg
<ul>
<li>Delphi
2011-03-17 09:35:18 +00:00
<ul>
<li>Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
2011-03-17 09:35:18 +00:00
</ul>
</li>
<li>Delphi
2011-03-17 09:35:18 +00:00
<ul>
<li>Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
2011-03-17 09:35:18 +00:00
</ul>
</li>
<li class="ui-state-disabled">Perch</li>
</ul>
</li>
<li class="ui-state-disabled">Amesville</li>
</ul>
<h2>Menu with icons</h2>
<ul id="menu3">
<li><span class="ui-icon ui-icon-print"></span>Aberdeen</li>
<li class="ui-state-disabled"><span class="ui-icon ui-icon-scissors"></span>Ada</li>
<li>Adamsville</li>
<li><span class="ui-icon ui-icon-wrench"></span>Addyston</li>
<li class="ui-state-disabled">Delphi
2011-04-20 15:18:15 +00:00
<ul>
<li>Ada</li>
<li><span class="ui-icon ui-icon-wrench"></span>Saarland</li>
<li>Salzburg</li>
2011-04-20 15:18:15 +00:00
</ul>
</li>
<li>Saarland</li>
2011-04-20 15:18:15 +00:00
<li>
<span class="ui-icon ui-icon-print"></span>Salzburg
2011-04-20 15:18:15 +00:00
<ul>
<li>
<span class="ui-icon ui-icon-wrench"></span>Delphi
2011-04-20 15:18:15 +00:00
<ul>
<li>Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
2011-04-20 15:18:15 +00:00
</ul>
</li>
<li>Delphi
2011-04-20 15:18:15 +00:00
<ul>
<li><span class="ui-icon ui-icon-wrench"></span>Ada</li>
<li><span class="ui-icon ui-icon-wrench"></span>Saarland</li>
<li><span class="ui-icon ui-icon-wrench"></span>Salzburg</li>
2011-04-20 15:18:15 +00:00
</ul>
</li>
<li>Perch</li>
2011-04-20 15:18:15 +00:00
</ul>
</li>
</ul>
<h2>Long menu with scroll overflow, to test menu's scroll-on-keypress behaviour</h2>
<ul class="menu4">
<li>Aberdeen</li>
<li>Ada</li>
<li>Adamsville</li>
<li>Addyston</li>
<li>Adelphi</li>
<li>Adena</li>
<li>Adrian</li>
<li>Akron</li>
<li>Albany</li>
<li>Alexandria</li>
<li>Alger</li>
<li>Alledonia</li>
<li>Alliance</li>
<li>Alpha</li>
<li>Alvada</li>
<li>Alvordton</li>
<li>Amanda</li>
<li>Amelia</li>
<li>Amesville</li>
<li>Aberdeen</li>
<li>Ada</li>
<li>Adamsville</li>
<li>Addyston</li>
<li>Adelphi</li>
<li>Adena</li>
<li>Adrian</li>
<li>Akron</li>
<li>Albany</li>
<li>Alexandria</li>
<li>Alger</li>
<li>Alledonia</li>
<li>Alliance</li>
<li>Alpha</li>
<li>Alvada</li>
<li>Alvordton</li>
<li>Amanda</li>
<li>Amelia</li>
<li>Amesville</li>
2010-03-20 20:51:53 +00:00
</ul>
<h2>Menu with custom markup</h2>
<div id="menu5">
<blockquote>Aberdeen</blockquote>
<blockquote>Ada</blockquote>
<blockquote class="ui-state-disabled">Adamsville</blockquote>
<blockquote>Addyston</blockquote>
<blockquote>Delphi
<div>
<blockquote>Ada</blockquote>
<blockquote>Saarland</blockquote>
<blockquote>Salzburg</blockquote>
</div>
</blockquote>
<blockquote>Saarland</blockquote>
<blockquote>Salzburg
<div>
<blockquote>Delphi
<div>
<blockquote>Ada</blockquote>
<blockquote>Saarland</blockquote>
<blockquote>Salzburg</blockquote>
</div>
</blockquote>
<blockquote>Delphi
<div>
<blockquote>Ada</blockquote>
<blockquote>Saarland</blockquote>
<blockquote>Salzburg</blockquote>
</div>
</blockquote>
<blockquote>Perch</blockquote>
</div>
</blockquote>
</div>
<h2>Menu with custom markup, multi-line items and a custom submenu icon</h2>
<div class="menuElement" id="menu6">
<div class="address-item">
<span class="address-header">John Doe</span>
<span class="address-content">78 West Main St Apt 3A</span>
<span class="address-content">Bloomsburg, PA 12345</span>
</div>
<div class="address-item">
<span class="address-header">Jane Doe</span>
<span class="address-content">78 West Main St Apt 3A</span>
<span class="address-content">Bloomsburg, PA 12345</span>
</div>
<div class="address-item ui-state-disabled">
<span class="address-header">James Doe</span>
<span class="address-content">78 West Main St Apt 3A</span>
<span class="address-content">Bloomsburg, PA 12345</span>
</div>
<div class="address-item">
<span class="address-header">Jenny Doe</span>
<span class="address-content">78 West Main St Apt 3A</span>
<span class="address-content">Bloomsburg, PA 12345</span>
</div>
<div class="address-item">
<span class="address-header">John Doe</span>
<span class="address-content">78 West Main St Apt 3A</span>
<span class="address-content">Bloomsburg, PA 12345</span>
<div class="menuElement">
<div>Ada</div>
<div>Saarland</div>
<div>Salzburg</div>
</div>
</div>
</div>
<h2>Inline with dividers and group labels</h2>
<ul id="menu7">
<li class="ui-menu-group"><strong>Group 1</strong></li>
<li>Aberdeen</li>
<li>Ada</li>
<li>Adamsville</li>
<li>Addyston</li>
<li></li>
<li class="ui-menu-group"><strong>Group 2</strong></li>
<li>Delphi
<ul>
<li>Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
</ul>
</li>
<li>Saarland</li>
<li>---</li>
<li class="ui-menu-group"><strong>Group 3</strong></li>
<li>Salzburg
<ul>
<li>Delphi
<ul>
<li>Ada</li>
<li> - </li>
<li>Saarland</li>
<li>&mdash;</li>
<li>Salzburg</li>
<li>&ndash;</li>
</ul>
</li>
<li>Delphi
<ul>
<li>Ada</li>
<li>Saarland</li>
<li>Salzburg</li>
</ul>
</li>
<li>Perch</li>
</ul>
</li>
<li>Amesville</li>
</ul>
2012-05-18 14:40:44 +00:00
<div style="position: absolute; top: 1em; right: 1em;">
2010-03-20 20:51:53 +00:00
Log:
2012-05-18 14:40:44 +00:00
<div id="log" style="height: 400px; width: 300px; overflow: auto; border: 1px solid #000;"></div>
2010-03-20 20:51:53 +00:00
</div>
</body>
2013-01-17 06:28:41 +00:00
</html>