diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-12 17:10:32 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-12 17:10:32 +0200 |
commit | e1a80d59003869f9078271b9b0df8c0e907e2f5b (patch) | |
tree | 9752d94f6da0be9b8cb93365038aba502b309317 /tests/visual/position | |
parent | 6ffc4adf06516c313122fac78e20f32daae6838b (diff) | |
download | jquery-ui-e1a80d59003869f9078271b9b0df8c0e907e2f5b.tar.gz jquery-ui-e1a80d59003869f9078271b9b0df8c0e907e2f5b.zip |
Position: Cleanup feedback test page
Diffstat (limited to 'tests/visual/position')
-rw-r--r-- | tests/visual/position/position_feedback.html | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/tests/visual/position/position_feedback.html b/tests/visual/position/position_feedback.html index b35c3b025..5b50ff32c 100644 --- a/tests/visual/position/position_feedback.html +++ b/tests/visual/position/position_feedback.html @@ -55,38 +55,24 @@ var rightElement = element.clone().height(150).width(150).appendTo('body'); element.width(150); $(document).on( "mousemove", function(event) { - // TODO explore allowing multiple option sets as argument to position - // .position(base, custom) - // should be pretty useful for plugins, which always have base options and user overrides - // first arg is required, if it looks good, look for argmuments.length > 1 - element.position({ + var base = { my: "left top", at: "left top", of: target, - offset: (event.pageX - targetOffset.left) + " " + (event.pageY - targetOffset.top), using: using - }); - oppositeElement.position({ - my: "left top", - at: "left top", - of: target, - offset: (-1 * (event.pageX - targetOffset.left)) + " " + (-1 * (event.pageY - targetOffset.top)), - using: using - }); - leftElement.position({ - my: "left top", - at: "left top", - of: target, - offset: (-0.9 * (event.pageX - targetOffset.left)) + " " + (0.9 * (event.pageY - targetOffset.top)), - using: using - }); - rightElement.position({ - my: "left top", - at: "left top", - of: target, - offset: (0.9 * (event.pageX - targetOffset.left)) + " " + (-0.9 * (event.pageY - targetOffset.top)), - using: using - }); + } + element.position( $.extend({ + offset: (event.pageX - targetOffset.left) + " " + (event.pageY - targetOffset.top) + }, base)); + oppositeElement.position( $.extend({ + offset: (-1 * (event.pageX - targetOffset.left)) + " " + (-1 * (event.pageY - targetOffset.top)) + }, base)); + leftElement.position( $.extend({ + offset: (-0.9 * (event.pageX - targetOffset.left)) + " " + (0.9 * (event.pageY - targetOffset.top)) + }, base)); + rightElement.position( $.extend({ + offset: (0.9 * (event.pageX - targetOffset.left)) + " " + (-0.9 * (event.pageY - targetOffset.top)) + }, base)); }); }); </script> |