Yahoo! UI Library

resize  2.5.1

Yahoo! UI Library > resize > YAHOO.util.Resize

Show Private Show Protected

Class YAHOO.util.Resize - extends YAHOO.util.Element

Makes an element resizable

Constructor

YAHOO.util.Resize ( el , attrs )
Parameters:
el <String/HTMLElement> The element to make resizable.
attrs <Object> Object liternal containing configuration parameters.

Properties

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

destroy

void destroy ( )
Destroys the resize object and all of it's elements & listeners.
Returns: void

getActiveHandleEl

HTMLElement getActiveHandleEl ( )
Get the HTML reference for the currently active resize handle.
Returns: HTMLElement
The handle element that is active

getProxyEl

HTMLElement getProxyEl ( )
Get the HTML reference for the proxy, returns null if no proxy.
Returns: HTMLElement
The proxy element

getResizeById

static Object getResizeById ( )
Get's a resize object by the HTML id of the element associated with the Resize object.
Returns: Object
The Resize Object

getStatusEl

HTMLElement getStatusEl ( )
Get the HTML reference for the status element.
Returns: HTMLElement
The status element

getWrapEl

HTMLElement getWrapEl ( )
Get the HTML reference for the wrap element, returns the current element if not wrapped.
Returns: HTMLElement
The wrap element

isActive

Boolean isActive ( )
Returns true or false if a resize operation is currently active on the element.
Returns: Boolean

reset

YAHOO.util.Resize reset ( )
Resets the element to is start state.
Returns: YAHOO.util.Resize
The Resize instance

resize

YAHOO.util.Resize resize ( ev , h , w , t , l , force , silent )
Resizes the element, wrapper or proxy based on the data from the handlers.
Parameters:
ev <Event> The mouse event.
h <Number> The new height setting.
w <Number> The new width setting.
t <Number> The new top setting.
l <Number> The new left setting.
force <Boolean> Resize the element (used for proxy resize).
silent <Boolean> Don't fire the beforeResize Event.
Returns: YAHOO.util.Resize
The Resize instance

toString

String toString ( )
Returns a string representing the Resize Object.
Returns: String

Events

animateChange

animateChange ( eventInfo )
Fires when the value for the configuration attribute 'animate' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

animateDurationChange

animateDurationChange ( eventInfo )
Fires when the value for the configuration attribute 'animateDuration' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

animateEasingChange

animateEasingChange ( eventInfo )
Fires when the value for the configuration attribute 'animateEasing' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

autoRatioChange

autoRatioChange ( eventInfo )
Fires when the value for the configuration attribute 'autoRatio' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeAnimateChange

beforeAnimateChange ( eventInfo )
Fires before the value for the configuration attribute 'animate' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeAnimateDurationChange

beforeAnimateDurationChange ( eventInfo )
Fires before the value for the configuration attribute 'animateDuration' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeAnimateEasingChange

beforeAnimateEasingChange ( eventInfo )
Fires before the value for the configuration attribute 'animateEasing' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeAutoRatioChange

beforeAutoRatioChange ( eventInfo )
Fires before the value for the configuration attribute 'autoRatio' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeDraggableChange

beforeDraggableChange ( eventInfo )
Fires before the value for the configuration attribute 'draggable' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeGhostChange

beforeGhostChange ( eventInfo )
Fires before the value for the configuration attribute 'ghost' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHandlesChange

beforeHandlesChange ( eventInfo )
Fires before the value for the configuration attribute 'handles' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHeightChange

beforeHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'height' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHiddenHandlesChange

beforeHiddenHandlesChange ( eventInfo )
Fires before the value for the configuration attribute 'hiddenHandles' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHoverChange

beforeHoverChange ( eventInfo )
Fires before the value for the configuration attribute 'hover' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeKnobHandlesChange

beforeKnobHandlesChange ( eventInfo )
Fires before the value for the configuration attribute 'knobHandles' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMaxHeightChange

beforeMaxHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'maxHeight' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMaxWidthChange

beforeMaxWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'maxWidth' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMaxXChange

beforeMaxXChange ( eventInfo )
Fires before the value for the configuration attribute 'maxX' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMaxYChange

beforeMaxYChange ( eventInfo )
Fires before the value for the configuration attribute 'maxY' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinHeightChange

beforeMinHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'minHeight' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinWidthChange

beforeMinWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'minWidth' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinXChange

beforeMinXChange ( eventInfo )
Fires before the value for the configuration attribute 'minX' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMinYChange

beforeMinYChange ( eventInfo )
Fires before the value for the configuration attribute 'minY' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeProxyChange

beforeProxyChange ( eventInfo )
Fires before the value for the configuration attribute 'proxy' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeRatioChange

beforeRatioChange ( eventInfo )
Fires before the value for the configuration attribute 'ratio' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeResize

beforeResize ( )
Fires before every element resize after the size calculations, returning false will stop the resize.

beforeSetSizeChange

beforeSetSizeChange ( eventInfo )
Fires before the value for the configuration attribute 'setSize' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeStatusChange

beforeStatusChange ( eventInfo )
Fires before the value for the configuration attribute 'status' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeWidthChange

beforeWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'width' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeWrapChange

beforeWrapChange ( eventInfo )
Fires before the value for the configuration attribute 'wrap' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeXTicksChange

beforeXTicksChange ( eventInfo )
Fires before the value for the configuration attribute 'xTicks' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeYTicksChange

beforeYTicksChange ( eventInfo )
Fires before the value for the configuration attribute 'yTicks' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

dragEvent

dragEvent ( )
Fires when the YAHOO.util.DragDrop dragEvent is fired for the config option draggable.

draggableChange

draggableChange ( eventInfo )
Fires when the value for the configuration attribute 'draggable' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

ghostChange

ghostChange ( eventInfo )
Fires when the value for the configuration attribute 'ghost' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

handlesChange

handlesChange ( eventInfo )
Fires when the value for the configuration attribute 'handles' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

heightChange

heightChange ( eventInfo )
Fires when the value for the configuration attribute 'height' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

hiddenHandlesChange

hiddenHandlesChange ( eventInfo )
Fires when the value for the configuration attribute 'hiddenHandles' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

hoverChange

hoverChange ( eventInfo )
Fires when the value for the configuration attribute 'hover' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

knobHandlesChange

knobHandlesChange ( eventInfo )
Fires when the value for the configuration attribute 'knobHandles' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

maxHeightChange

maxHeightChange ( eventInfo )
Fires when the value for the configuration attribute 'maxHeight' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

maxWidthChange

maxWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'maxWidth' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

maxXChange

maxXChange ( eventInfo )
Fires when the value for the configuration attribute 'maxX' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

maxYChange

maxYChange ( eventInfo )
Fires when the value for the configuration attribute 'maxY' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minHeightChange

minHeightChange ( eventInfo )
Fires when the value for the configuration attribute 'minHeight' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minWidthChange

minWidthChange ( eventInfo )
Fires when the value for the configuration attribute 'minWidth' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minXChange

minXChange ( eventInfo )
Fires when the value for the configuration attribute 'minX' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

minYChange

minYChange ( eventInfo )
Fires when the value for the configuration attribute 'minY' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

proxyChange

proxyChange ( eventInfo )
Fires when the value for the configuration attribute 'proxy' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

proxyResize

proxyResize ( )
Fires on every proxy resize (only fires when used with proxy config setting).

ratioChange

ratioChange ( eventInfo )
Fires when the value for the configuration attribute 'ratio' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

resize

resize ( )
Fires on every element resize (only fires once when used with proxy config setting).

setSizeChange

setSizeChange ( eventInfo )
Fires when the value for the configuration attribute 'setSize' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

startResize

startResize ( )
Fires when when a resize action is started.

statusChange

statusChange ( eventInfo )
Fires when the value for the configuration attribute 'status' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

widthChange

widthChange ( eventInfo )
Fires when the value for the configuration attribute 'width' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

wrapChange

wrapChange ( eventInfo )
Fires when the value for the configuration attribute 'wrap' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

xTicksChange

xTicksChange ( eventInfo )
Fires when the value for the configuration attribute 'xTicks' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

yTicksChange

yTicksChange ( eventInfo )
Fires when the value for the configuration attribute 'yTicks' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

Configuration Attributes

animate - Boolean

Should be use animation to resize the element (can only be used if we use proxy).

animateDuration - Number

The Duration to apply to the animation.

animateEasing - Object

The Easing to apply to the animation.

autoRatio - Boolean

Using the shift key during a resize will toggle the ratio config.

draggable - Boolean

A convienence method to make the element draggable

ghost - Boolean

Apply an opacity filter to the element being resized (only works with proxy).

handles - Array

The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. Defaults to: ['r', 'b', 'br']. Can use a shortcut of All. Note: 8 way resizing should be done on an element that is absolutely positioned.

height - Number

The height of the element

hiddenHandles - Boolean

Don't show the handles, just use the cursor to the user.

hover - Boolean

Only show the handles when they are being moused over.

knobHandles - Boolean

Use the smaller handles, instead if the full size handles.

maxHeight - Number

The maximum height of the element

maxWidth - Number

The maximum width of the element

maxX - Number

The max x coord of the element

maxY - Number

The max y coord of the element

minHeight - Number

The minimum height of the element

minWidth - Number

The minimum width of the element

minX - Number

The minimum x coord of the element

minY - Number

The minimum y coord of the element

proxy - Boolean

Resize a proxy element instead of the real element.

ratio - Boolean

Maintain the element's ratio when resizing.

setSize - Boolean

Set the size of the resized element, if set to false the element will not be auto resized, the resize event will contain the dimensions so the end user can resize it on their own. This setting will only work with proxy set to true and animate set to false.

status - Boolean

Show the status (new size) of the resize.

width - Number

The width of the element

wrap - Boolean

Should we wrap the element

xTicks - Number or False

The number of x ticks to span the resize to.

yTicks - Number or False

The number of y ticks to span the resize to.

Configuration attributes inherited from YAHOO.util.Element:


Copyright © 2007 Yahoo! Inc. All rights reserved.