Web Development with jQuery (2015)
Part IV. Appendices
Appendix R. Resizable
Resizable Methods |
||
Method |
Description |
Return Value |
resizable(options) |
Makes the selected elements into resizable elements (see “Resizable Options”). |
jQuery |
resizable('destroy') |
Completely removes resizable functionality. |
jQuery |
resizable('disable') |
Temporarily disables resizable functionality. |
jQuery |
resizable('enable') |
Enables resizable functionality. |
jQuery |
resizable('option') |
Returns an object of all currently set options as an object of key, value pairs. |
Object |
resizable('option', optionName) |
Returns the specified option's value. |
Mixed |
resizable('option', optionName,value) |
Sets the specified option to the specified value. |
jQuery |
Resizable Options |
||
Option |
Description |
Type |
alsoResize |
One or more elements that should be resizing simultaneously with the resizable element. |
Selector, jQuery, Element |
animate |
Animates to the final size after resizing. |
Boolean |
animateDuration |
Duration time for animating. Accepts the time in milliseconds (ms), or one of 'slow', 'normal', or 'fast'. |
Number, String |
animateEasing |
Easing effect for animation. |
String |
aspectRatio |
When set to true, resizing is constrained by the original aspect ratio. If an alternative ratio is wanted, you can submit a number and then the aspect ratio will be constrained by height\width. |
Boolean, Number |
autoHide |
When set to true, automatically hides the handles except when the mouse hovers over the element. |
Boolean |
cancel |
Prevents resizing if you start on elements matching the selector. |
Selector |
containment |
Constrains resizing to within the bounds of the specified element. This can be a DOM element, 'parent', 'document', or a selector. |
Boolean, Element, Selector, String |
delay |
Time in milliseconds (ms) to define when dragging should start. It helps prevent unwanted drags when clicking an element. |
Number |
disabled |
Disables the resizable if the value is set to true. |
Boolean |
distance |
Tolerance in pixels, for when resizing should start. If specified, resizing will not start until after the mouse is moved beyond the specified distance. |
Number |
ghost |
When set to true, a substitute element is displayed while resizing. |
Boolean |
grid |
Snaps the resizing element to a grid size, every x and y pixel. |
Array[x, y] |
handles |
Customizes handles used for resizing. |
String, Object |
helper |
This is the CSS class that will be added to a proxy element to outline the resize during the drag of the resize handle. When the resize is complete, the original element is sized. |
Boolean, String |
maxHeight |
This is the maximum height the resizable should be allowed to resize to. |
Number |
maxWidth |
This is the maximum width the resizable should be allowed to resize to. |
Number |
minHeight |
This is the minimum height the resizable should be allowed to resize to. |
Number |
minWidth |
This is the minimum width the resizable should be allowed to resize to. |
Number |
Resizable Events |
||
Option |
Description |
Value |
create |
A function executed when a resizable element is created. |
function(event, ui) |
resize |
This function is called during the resize, on the drag of any resize handle. |
function(event, ui) |
start |
This function is executed when a resize starts. |
function(event, ui) |
stop |
This function is called at the end of a resize operation. |
function(event, ui) |
UI Object |
||
Option |
Description |
Type |
ui.element |
A jQuery object representing the resizable element. |
jQuery |
ui.helper |
A jQuery object representing the helper that's being resized. |
jQuery |
ui.originalElement |
A jQuery object representing the original element before it was wrapped with the resizable plugin. |
jQuery |
ui.originalPosition |
An object representing the original position with the keys left and top. |
Object |
ui.originalSize |
An object containing the original width and height, before an element was resized. |
Object |
ui.position |
An object containing the current position with the keys left and top. |
Object |
ui.size |
An object containing the current size of the resizable element with the keys width and height. |
Object |