Skip to content

Commit b0bcc70

Browse files
committed
Resizable: size and position properties can be modifed in resize event
Fixes gh-220 Closes gh-254
1 parent de30ed8 commit b0bcc70

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

entries/resizable.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,22 @@
153153
<desc>The size represented as <code>{ width, height }</code> before the resizable is resized</desc>
154154
</property>
155155
<property name="position" type="Object">
156-
<desc>The current position represented as <code>{ left, top }</code></desc>
156+
<desc>The current position represented as <code>{ left, top }</code>. The values may be changed to modify where the element will be positioned. Useful for custom resizing logic.</desc>
157157
</property>
158158
<property name="size" type="Object">
159-
<desc>The current size represented as <code>{ width, height }</code></desc>
159+
<desc>The current size represented as <code>{ width, height }</code>. The values may be changed to modify where the element will be positioned. Useful for custom resizing logic.</desc>
160160
</property>
161161
</argument>
162+
<example>
163+
<desc>Restrict height resizing to 30 pixel increments:</desc>
164+
<code><![CDATA[
165+
$( ".selector" ).resizable({
166+
resize: function( event, ui ) {
167+
ui.size.height = Math.round( ui.size.height / 30 ) * 30;
168+
}
169+
});
170+
]]></code>
171+
</example>
162172
</event>
163173
<event name="stop">
164174
<desc>This event is triggered at the end of a resize operation.</desc>

0 commit comments

Comments
 (0)