diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-07-30 11:33:49 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-07-30 11:33:49 +0200 |
commit | 3f45f5ccf93853e9f309cdb052dc47d88e393516 (patch) | |
tree | dd9ba6896d2da5ba38db75d0dcc27c6375c8300d | |
parent | 61e0aeac7e626df711e7066f27b652602387b784 (diff) | |
download | jquery-ui-3f45f5ccf93853e9f309cdb052dc47d88e393516.tar.gz jquery-ui-3f45f5ccf93853e9f309cdb052dc47d88e393516.zip |
Improving visual testcase for position. Partial fix for #5284 - Position: Smarter collision detection
-rw-r--r-- | tests/visual/position/position.html | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/visual/position/position.html b/tests/visual/position/position.html index 364fd32b2..4f6e04497 100644 --- a/tests/visual/position/position.html +++ b/tests/visual/position/position.html @@ -13,27 +13,29 @@ <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script> <script type="text/javascript"> $(function() { - var ul = $("ul"); - $("input").each(function() { - $(this).position({ - my: this.id.replace(/-/, " "), - at: this.id.replace(/-/, " "), - of: "#container", - collision: "none" + var inputs = $("input"); + $("ul").insertAfter(inputs); + $(window).resize(function() { + inputs.each(function() { + $(this).position({ + my: this.id.replace(/-/, " "), + at: this.id.replace(/-/, " "), + of: "#container", + collision: "none" + }); + $(this).next().menu().position({ + my: "left top", + at: "left bottom", + of: this + }); }); - ul.clone().insertAfter(this).menu().position({ - my: "left top", - at: "left bottom", - of: this - }); - }); - ul.remove(); + }).resize(); }); </script> <style> input, .ui-menu { position: absolute; } .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; } </style> </head> |