mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Improving visual testcase for position. Partial fix for #5284 - Position: Smarter collision detection
This commit is contained in:
parent
61e0aeac7e
commit
3f45f5ccf9
@ -13,27 +13,29 @@
|
|||||||
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
|
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var ul = $("ul");
|
var inputs = $("input");
|
||||||
$("input").each(function() {
|
$("ul").insertAfter(inputs);
|
||||||
|
$(window).resize(function() {
|
||||||
|
inputs.each(function() {
|
||||||
$(this).position({
|
$(this).position({
|
||||||
my: this.id.replace(/-/, " "),
|
my: this.id.replace(/-/, " "),
|
||||||
at: this.id.replace(/-/, " "),
|
at: this.id.replace(/-/, " "),
|
||||||
of: "#container",
|
of: "#container",
|
||||||
collision: "none"
|
collision: "none"
|
||||||
});
|
});
|
||||||
ul.clone().insertAfter(this).menu().position({
|
$(this).next().menu().position({
|
||||||
my: "left top",
|
my: "left top",
|
||||||
at: "left bottom",
|
at: "left bottom",
|
||||||
of: this
|
of: this
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
ul.remove();
|
}).resize();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
input, .ui-menu { position: absolute; }
|
input, .ui-menu { position: absolute; }
|
||||||
.ui-menu { width: 200px; }
|
.ui-menu { width: 200px; }
|
||||||
html, body { width: 100%; height: 100% }
|
html, body { width: 99%; height: 99% }
|
||||||
#container { width: 95%; height: 95%; border: 1px solid black; margin: auto; }
|
#container { width: 95%; height: 95%; border: 1px solid black; margin: auto; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user