aboutsummaryrefslogtreecommitdiffstats
path: root/tests/visual/position/position_flip.html
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2011-08-12 22:19:52 -0500
committerkborchers <kris.borchers@gmail.com>2011-08-12 22:19:52 -0500
commit80bbebd4893ca0d75d556553a74550d01f52892f (patch)
treedabf8003668671617441d275d7f15200fed9042a /tests/visual/position/position_flip.html
parentac04462d22d30f4b1a5e0dd34d57fbcc0450b48d (diff)
downloadjquery-ui-80bbebd4893ca0d75d556553a74550d01f52892f.tar.gz
jquery-ui-80bbebd4893ca0d75d556553a74550d01f52892f.zip
Position: Added better collision detection for flip and fit, added visual tests for each and updated the unit tests to take the changes into account. In the process, I removed the rounding that was being done to the position since older jQuery couldn't handle the fractions. There was another pull for this same issue and I have merged the unit tests from that pull into this commit. Also added flipfit!
Diffstat (limited to 'tests/visual/position/position_flip.html')
-rw-r--r--tests/visual/position/position_flip.html77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/visual/position/position_flip.html b/tests/visual/position/position_flip.html
new file mode 100644
index 000000000..f4a3849ef
--- /dev/null
+++ b/tests/visual/position/position_flip.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8" />
+ <title>Position Visual Test: Flip</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.6.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" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
+ <script type="text/javascript">
+ $(function() {
+ var inputs = $("input");
+ $("ul").insertAfter(inputs);
+ inputs.each(function(index) {
+ $(this).position({
+ my: this.id.replace(/-/, " "),
+ at: this.id.replace(/-/, " "),
+ of: "#container"+index,
+ collision: "none"
+ });
+ $(this).next().menu().position({
+ my: "left top",
+ at: "left bottom",
+ of: this,
+ within: "#container"+index
+ });
+ });
+ });
+ </script>
+ <style>
+ input, .ui-menu { position: absolute; }
+ .ui-menu { width: 300px; }
+ #ui-menu-6, #ui-menu-7, #ui-menu-8 { 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" style="width:300px;"></div>
+<div id="container4" class="container" style="width:300px;"></div>
+<div id="container5" class="container" style="width:300px;"></div>
+<div style="clear:both;"></div>
+<div id="container6" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container7" class="container" style="height:100px; margin-bottom: 500px;"></div>
+<div id="container8" class="container" style="height:100px; margin-bottom: 500px;"></div>
+
+<input id="left-top" />
+<input id="center-top" />
+<input id="right-top" />
+<input id="left-center" />
+<input id="center-center" />
+<input id="right-center" />
+<input id="left-bottom" />
+<input id="center-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>