2010-03-21 18:48:30 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
2010-03-21 18:52:18 +00:00
|
|
|
<title>Position Visual Test: Default</title>
|
2010-03-21 18:48:30 +00:00
|
|
|
<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" />
|
2012-03-22 13:45:22 +00:00
|
|
|
<script type="text/javascript" src="../../../jquery-1.7.2.js"></script>
|
2010-03-21 18:48:30 +00:00
|
|
|
<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>
|
2010-04-21 19:01:08 +00:00
|
|
|
<script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script>
|
2010-03-21 18:48:30 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
2010-07-30 09:33:49 +00:00
|
|
|
var inputs = $("input");
|
|
|
|
$("ul").insertAfter(inputs);
|
|
|
|
$(window).resize(function() {
|
|
|
|
inputs.each(function() {
|
2012-04-10 16:11:28 +00:00
|
|
|
var input = $(this).position({
|
2010-07-30 09:33:49 +00:00
|
|
|
my: this.id.replace(/-/, " "),
|
|
|
|
at: this.id.replace(/-/, " "),
|
|
|
|
of: "#container",
|
|
|
|
collision: "none"
|
|
|
|
});
|
2012-04-10 16:11:28 +00:00
|
|
|
var menu = $(this).next().menu()
|
|
|
|
menu.position({
|
2012-04-11 23:32:30 +00:00
|
|
|
my: "left+30 top+20",
|
2010-07-30 09:33:49 +00:00
|
|
|
at: "left bottom",
|
2012-04-03 08:49:34 +00:00
|
|
|
of: this,
|
2012-04-10 20:16:38 +00:00
|
|
|
using: function( position, feedback ) {
|
|
|
|
input.val(feedback.horizontal + " " + feedback.vertical)
|
2012-04-11 23:32:30 +00:00
|
|
|
$(this).offset( position );
|
|
|
|
$(this)
|
|
|
|
.removeClass("left right top bottom center middle")
|
2012-04-10 20:16:38 +00:00
|
|
|
.addClass(feedback.horizontal)
|
|
|
|
.addClass(feedback.vertical);
|
2012-04-10 16:11:28 +00:00
|
|
|
}
|
2010-07-30 09:33:49 +00:00
|
|
|
});
|
2010-03-21 18:48:30 +00:00
|
|
|
});
|
2010-07-30 09:33:49 +00:00
|
|
|
}).resize();
|
2010-03-21 18:48:30 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
input, .ui-menu { position: absolute; }
|
|
|
|
.ui-menu { width: 200px; }
|
2011-05-13 22:21:52 +00:00
|
|
|
html, body { width: 99%; height: 99%; min-height:700px; min-width:700px; }
|
2010-03-21 18:48:30 +00:00
|
|
|
#container { width: 95%; height: 95%; border: 1px solid black; margin: auto; }
|
2012-04-03 08:49:34 +00:00
|
|
|
.ui-menu:before {
|
|
|
|
font-size: 12pt;
|
|
|
|
content: "↑";
|
|
|
|
position: absolute;
|
|
|
|
top: -22px;
|
|
|
|
left: 5px;
|
|
|
|
}
|
2012-04-10 16:11:28 +00:00
|
|
|
.right:before {
|
2012-04-03 08:49:34 +00:00
|
|
|
left: auto;
|
|
|
|
right: 5px;
|
|
|
|
}
|
2012-04-10 16:11:28 +00:00
|
|
|
.bottom:before {
|
2012-04-03 08:49:34 +00:00
|
|
|
content: "↓";
|
|
|
|
top: auto;
|
|
|
|
bottom: -19px;
|
|
|
|
}
|
2010-03-21 18:48:30 +00:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div id="container"></div>
|
|
|
|
|
|
|
|
<input id="left-top" />
|
|
|
|
<input id="left-center" />
|
|
|
|
<input id="left-bottom" />
|
|
|
|
<input id="center-top" />
|
|
|
|
<input id="center-center" />
|
|
|
|
<input id="center-bottom" />
|
|
|
|
<input id="right-top" />
|
|
|
|
<input id="right-center" />
|
|
|
|
<input id="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>
|