diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-20 11:06:11 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-20 11:06:11 -0400 |
commit | 308b55e50ca781ad9db08a252f313ee2e8e2f257 (patch) | |
tree | b287b6936d45efdfe067d2bdf4c732b13a1726bd /demos | |
parent | 2cf9948cadf45a24c591d6f7232f2470b4d9743e (diff) | |
parent | 33df9b788d3f60459c43acbfefdfeef8a07ce632 (diff) | |
download | jquery-ui-308b55e50ca781ad9db08a252f313ee2e8e2f257.tar.gz jquery-ui-308b55e50ca781ad9db08a252f313ee2e8e2f257.zip |
Merge branch 'master' into position-notification
Diffstat (limited to 'demos')
-rw-r--r-- | demos/position/default.html | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/demos/position/default.html b/demos/position/default.html index 202417348..01137be62 100644 --- a/demos/position/default.html +++ b/demos/position/default.html @@ -1,4 +1,4 @@ -<!DOCTYPE html> +<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> @@ -37,53 +37,28 @@ width: 120px; height: 40px; } - .ui-flipped-top { - border-top: 3px solid #000000; - } - .ui-flipped-bottom { - border-bottom: 3px solid #000000; - } - .ui-flipped-left { - border-left: 3px solid #000000; - } - .ui-flipped-right { - border-right: 3px solid #000000; - } select, input { margin-left: 15px; } </style> <script> $(function() { - function position( using ) { + function position() { $( ".positionable" ).position({ of: $( "#parent" ), my: $( "#my_horizontal" ).val() + " " + $( "#my_vertical" ).val(), at: $( "#at_horizontal" ).val() + " " + $( "#at_vertical" ).val(), offset: $( "#offset" ).val(), - using: using, - collision: $( "#collision_horizontal" ).val() + ' ' + $( "#collision_vertical" ).val() + collision: $( "#collision_horizontal" ).val() + " " + $( "#collision_vertical" ).val() }); } $( ".positionable" ).css( "opacity", 0.5 ); - $( ":input" ).bind( "click keyup change", function() { position(); }); + $( ":input" ).bind( "click keyup change", position ); $( "#parent" ).draggable({ - drag: function() { position(); } - }); - - $( ".positionable" ).draggable({ - drag: function( event, ui ) { - // reset offset before calculating it - $( "#offset" ).val( "0" ); - position(function( result ) { - $( "#offset" ).val( "" + ( ui.offset.left - result.left ) + - " " + ( ui.offset.top - result.top ) ); - position(); - }); - } + drag: position }); position(); @@ -142,7 +117,7 @@ </div> <div style="padding-bottom: 20px;"> <b>offset:</b> - <input id="offset" type="text" size="15"/> + <input id="offset"> </div> <div style="padding-bottom: 20px;"> <b>collision:</b> |