mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-23 01:24:22 +00:00
305 lines
7.0 KiB
HTML
305 lines
7.0 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Menu Visual Test: Default</title>
|
|
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
|
|
<script src="../../../jquery-1.10.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() {
|
|
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"
|
|
},
|
|
select: logger
|
|
});
|
|
|
|
$( "#menu5" ).menu({
|
|
menus: "div",
|
|
select: logger
|
|
});
|
|
|
|
$( "#menu6" ).menu({
|
|
menus: ".menuElement",
|
|
select: logger,
|
|
icon: "ui-icon-carat-1-s"
|
|
});
|
|
|
|
$( "#menu7" ).menu({
|
|
items: "> :not('.ui-menu-group')",
|
|
select: logger
|
|
});
|
|
});
|
|
</script>
|
|
<style>
|
|
body { font-size:62.5%; }
|
|
.ui-menu { width: 200px; margin-bottom: 2em; }
|
|
.menu2-container { width: 220px; }
|
|
.menu4 { height: 200px; 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; }
|
|
</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>
|
|
</ul>
|
|
|
|
<h2>Inline with disabled items and submenus</h2>
|
|
<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
|
|
<ul>
|
|
<li>Ada</li>
|
|
<li>Saarland</li>
|
|
<li>Salzburg</li>
|
|
</ul>
|
|
</li>
|
|
<li>Delphi
|
|
<ul>
|
|
<li>Ada</li>
|
|
<li>Saarland</li>
|
|
<li>Salzburg</li>
|
|
</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
|
|
<ul>
|
|
<li>Ada</li>
|
|
<li><span class="ui-icon ui-icon-wrench"></span>Saarland</li>
|
|
<li>Salzburg</li>
|
|
</ul>
|
|
</li>
|
|
<li>Saarland</li>
|
|
<li>
|
|
<span class="ui-icon ui-icon-print"></span>Salzburg
|
|
<ul>
|
|
<li>
|
|
<span class="ui-icon ui-icon-wrench"></span>Delphi
|
|
<ul>
|
|
<li>Ada</li>
|
|
<li>Saarland</li>
|
|
<li>Salzburg</li>
|
|
</ul>
|
|
</li>
|
|
<li>Delphi
|
|
<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>
|
|
</ul>
|
|
</li>
|
|
<li>Perch</li>
|
|
</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>
|
|
</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>—</li>
|
|
<li>Salzburg</li>
|
|
<li>–</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>
|
|
|
|
<div style="position: absolute; top: 1em; right: 1em;">
|
|
Log:
|
|
<div id="log" style="height: 400px; width: 300px; overflow: auto; border: 1px solid #000;"></div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|