jquery-ui/tests/visual/position/position_flipfit.html
2012-04-26 10:06:01 -04:00

86 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Position Visual Test: FlipFit</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.7.2.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.menu.js"></script>
<script type="text/javascript">
$(function() {
var inputs = $("input");
$("ul").insertAfter(inputs);
inputs.each(function(index) {
$(this).position({
my: $(this).data("position"),
at: $(this).data("position"),
of: "#container"+index,
collision: "none"
});
$(this).next().menu().position({
my: index > 2 && index < 6 ? "right top" : "left top",
at: index > 2 && index < 6 ? "right bottom" : "left bottom",
of: this,
within: "#container"+index,
collision: "flipfit"
});
});
});
</script>
<style>
input, .ui-menu { position: absolute; }
.ui-menu { width: 300px; }
#ui-menu-3, #ui-menu-4, #ui-menu-5 { width: 185px; }
#ui-menu-9, #ui-menu-10, #ui-menu-11 { width: auto; }
html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
.container { width: 200px; height: 200px; border: 1px solid black; display:inline-block; margin-left: 230px; margin-top: 150px; }
</style>
</head>
<body>
<div id="container0" class="container"></div>
<div id="container1" class="container"></div>
<div id="container2" class="container"></div><br>
<div style="clear:both;"></div>
<div id="container3" class="container"></div>
<div id="container4" class="container"></div>
<div id="container5" class="container"></div><br>
<div style="clear:both;"></div>
<div id="container6" class="container" style="width:300px;"></div>
<div id="container7" class="container" style="width:300px;"></div>
<div id="container8" class="container" style="width:300px;"></div>
<div style="clear:both;"></div>
<div id="container9" class="container" style="height:100px; margin-bottom: 500px;"></div>
<div id="container10" class="container" style="height:100px; margin-bottom: 500px;"></div>
<div id="container11" class="container" style="height:100px; margin-bottom: 500px;"></div>
<input data-position="left top" />
<input data-position="center top" />
<input data-position="right top" />
<input data-position="left top" />
<input data-position="center top" />
<input data-position="right top" />
<input data-position="left center" />
<input data-position="center center" />
<input data-position="right center" />
<input data-position="left bottom" />
<input data-position="center center" />
<input data-position="right bottom" />
<ul>
<li><a href="#">Java</a></li>
<li><a href="#">JavaScript</a></li>
<li><a href="#">Perl</a></li>
<li><a href="#">Ruby</a></li>
<li><a href="#">C++</a></li>
<li><a href="#">Python</a></li>
<li><a href="#">C#</a></li>
</ul>
</body>
</html>