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

177 lines
4.9 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Visual Test for Popup Utility</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" />
<script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.popup.js"></script>
<!--
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
-->
<script type="text/javascript">
$(function() {
$.fn.themeswitcher && $('<div/>').css({
position: "absolute",
right: 10,
top: 10
}).appendTo(document.body).themeswitcher();
var selected = {
select: function( event, ui ) {
$( "<div/>" ).text( "Selected: " + ui.item.text() ).appendTo( "#log" );
$(this).popup("close");
}
};
2011-05-03 20:42:35 +00:00
$("#members-popup").popup();
$("#button1").button();
$("#menu1").menu(selected).popup();
$( "#rerun" )
.button()
.click(function() {
alert( "Running the last action" );
})
.next()
.button({
text: false,
icons: {
primary: "ui-icon-triangle-1-s"
}
})
.parent()
.buttonset()
.next()
.menu(selected)
.popup({
trigger: $("#select")
});
$("td:has(.menubar)").clone().appendTo("tbody tr:not(:first)");
$("table .menubar > ul").menu(selected).popup().prev().button();
});
</script>
<style type="text/css">
body { font-size:62.5%; }
.ui-popup { position: absolute; z-index: 5000; }
.ui-menu { width: 200px; }
table {
border-collapse: collapse;
}
th, td {
padding: 0.5em;
border: 1px solid black;
}
2011-05-03 20:42:35 +00:00
#members-popup {
width: 200px; height: 150px; border: 1px solid gray; border-radius: 5px;
box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, 0.5);
background: lightgray; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#ddd));
2011-05-04 06:20:41 +00:00
font-size: 120%; text-align: center; line-height: 150px; outline: none;
2011-05-03 20:42:35 +00:00
}
</style>
</head>
<body>
2011-05-03 20:42:35 +00:00
<div>
<a href="#members-popup">Project members</a>
<div id="members-popup" tabIndex="0">
some form controls in here
</div>
</div>
<button id="button1">Show context menu 1</button>
<ul id="menu1">
<li><a href="#">Amsterdam</a></li>
<li><a href="#">Anaheim</a></li>
<li><a href="#">Cologne</a></li>
<li><a href="#">Frankfurt</a></li>
<li><a href="#">Magdeburg</a></li>
<li><a href="#">Munich</a></li>
<li><a href="#">Utrecht</a></li>
<li><a href="#">Zurich</a></li>
</ul>
2011-05-03 20:42:35 +00:00
<div>
<div>
<button id="rerun">Run last action</button>
<button id="select">Select an action</button>
</div>
<ul>
<li><a href="#">Open...</a></li>
<li><a href="#">Save</a></li>
<li><a href="#">Delete</a></li>
</ul>
</div>
<table id="movies" class="ui-widget">
<thead>
<tr>
<th data-field="Name" class="ui-widget-header">Name</th>
<th data-field="ReleaseYear" class="ui-widget-header">Release Year</th>
<th data-field="AverageRating" class="ui-widget-header">Average Rating</th>
<th class="ui-widget-header"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="ui-widget-content">Red Hot Chili Peppers: Funky Monks</td>
<td class="ui-widget-content">1993</td>
<td class="ui-widget-content">3.6</td>
<td class="ui-widget-content">
<div class="menubar">
<a href="#">Options</a>
<ul>
<li><a href="#">Order...</a></li>
<li class="ui-state-disabled">Write a Review...</li>
<li><a href="#">Find Similar Movies...</a></li>
<li>
<a href="#">Rate</a>
<ul>
<li><a href="#">5 stars</a></li>
<li><a href="#">4 stars</a></li>
<li><a href="#">3 stars</a></li>
<li><a href="#">2 stars</a></li>
<li><a href="#">1 stars</a></li>
</ul>
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="ui-widget-content">Rod Stewart: Storyteller 1984-1991</td>
<td class="ui-widget-content">1991</td>
<td class="ui-widget-content">3.1</td>
</tr>
<tr>
<td class="ui-widget-content">Stevie Ray Vaughan and Double Trouble: Live at the El Mocambo 1983</td>
<td class="ui-widget-content">1991</td>
<td class="ui-widget-content">3.9</td>
</tr>
<tr>
<td class="ui-widget-content">Spike and Mike's Sick &amp; Twisted Festival of Animation</td>
<td class="ui-widget-content">1997</td>
<td class="ui-widget-content">2.6</td>
</tr>
</tbody>
</table>
<div class="ui-widget" style="margin-top:2em; font-family:Arial">
Log:
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>
</body>
</html>