|
1 |
| -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 | 4 | <meta charset="utf-8">
|
|
37 | 37 | width: 120px;
|
38 | 38 | height: 40px;
|
39 | 39 | }
|
40 |
| - .ui-flipped-top { |
41 |
| - border-top: 3px solid #000000; |
42 |
| - } |
43 |
| - .ui-flipped-bottom { |
44 |
| - border-bottom: 3px solid #000000; |
45 |
| - } |
46 |
| - .ui-flipped-left { |
47 |
| - border-left: 3px solid #000000; |
48 |
| - } |
49 |
| - .ui-flipped-right { |
50 |
| - border-right: 3px solid #000000; |
51 |
| - } |
52 | 40 | select, input {
|
53 | 41 | margin-left: 15px;
|
54 | 42 | }
|
55 | 43 | </style>
|
56 | 44 | <script>
|
57 | 45 | $(function() {
|
58 |
| - function position( using ) { |
| 46 | + function position() { |
59 | 47 | $( ".positionable" ).position({
|
60 | 48 | of: $( "#parent" ),
|
61 | 49 | my: $( "#my_horizontal" ).val() + " " + $( "#my_vertical" ).val(),
|
62 | 50 | at: $( "#at_horizontal" ).val() + " " + $( "#at_vertical" ).val(),
|
63 | 51 | offset: $( "#offset" ).val(),
|
64 |
| - using: using, |
65 |
| - collision: $( "#collision_horizontal" ).val() + ' ' + $( "#collision_vertical" ).val() |
| 52 | + collision: $( "#collision_horizontal" ).val() + " " + $( "#collision_vertical" ).val() |
66 | 53 | });
|
67 | 54 | }
|
68 | 55 |
|
69 | 56 | $( ".positionable" ).css( "opacity", 0.5 );
|
70 | 57 |
|
71 |
| - $( ":input" ).bind( "click keyup change", function() { position(); }); |
| 58 | + $( ":input" ).bind( "click keyup change", position ); |
72 | 59 |
|
73 | 60 | $( "#parent" ).draggable({
|
74 |
| - drag: function() { position(); } |
75 |
| - }); |
76 |
| - |
77 |
| - $( ".positionable" ).draggable({ |
78 |
| - drag: function( event, ui ) { |
79 |
| - // reset offset before calculating it |
80 |
| - $( "#offset" ).val( "0" ); |
81 |
| - position(function( result ) { |
82 |
| - $( "#offset" ).val( "" + ( ui.offset.left - result.left ) + |
83 |
| - " " + ( ui.offset.top - result.top ) ); |
84 |
| - position(); |
85 |
| - }); |
86 |
| - } |
| 61 | + drag: position |
87 | 62 | });
|
88 | 63 |
|
89 | 64 | position();
|
|
142 | 117 | </div>
|
143 | 118 | <div style="padding-bottom: 20px;">
|
144 | 119 | <b>offset:</b>
|
145 |
| - <input id="offset" type="text" size="15"/> |
| 120 | + <input id="offset"> |
146 | 121 | </div>
|
147 | 122 | <div style="padding-bottom: 20px;">
|
148 | 123 | <b>collision:</b>
|
|
0 commit comments