|
Element(String/HTMLElement element , [Boolean forceNew ]) |
Element |
Create a new Element directly. |
|
addClass(String/Array className ) : YAHOO.ext.Element |
Element |
Add a CSS class to the element. |
|
addClassOnOver(String className ) : YAHOO.ext.Element |
Element |
Sets up event handlers to add and remove a css class when the mouse is over this element |
|
addHandler(String eventName , Boolean stopPropagation , Function handler , [Object scope ], [boolean override ]) : YAHOO.ext.Element |
Element |
Appends an event handler to this element. The difference between this function and addListener is this
function preve... |
|
addKeyListener(Number/Array/Object/String key , Function fn , [Object scope ]) : YAHOO.ext.KeyMap |
Element |
Convenience method for constructing a KeyMap |
|
addKeyMap(Object config ) : YAHOO.ext.KeyMap |
Element |
Creates a KeyMap for this element |
|
addListener(String eventName , Function handler , [Object scope ], [boolean override ]) : YAHOO.ext.Element |
Element |
Appends an event handler to this element |
|
addManagedListener(String eventName , Function fn , [Object scope ], [boolean override ]) : Function |
Element |
Append a managed listener - See YAHOO.ext.EventObject for more details. Use mon() for a shorter version. |
|
alignTo(String/HTMLElement/YAHOO.ext.Element element , String position , [Array offsets ], [Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Align this element with another element. |
|
animate(Object args , [Float duration ], [Function onComplete ], [Function easing ], [Function animType ]) : YAHOO.ext.Element |
Element |
Perform Yahoo UI animation on this element. |
|
appendChild(String/HTMLElement/Array/Element/CompositeElement el ) : YAHOO.ext.Element |
Element |
Appends the passed element(s) to this element |
|
appendTo(String/HTMLElement/Element el ) : YAHOO.ext.Element |
Element |
Appends this element to the passed element |
|
applyStyles(String/Object/Function styles ) : YAHOO.ext.Element |
Element |
More flexible version of setStyle for setting style properties. |
|
autoHeight([Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Measures the elements content height and updates height to match. Note, this function uses setTimeout and
the new he... |
|
beginMeasure() : YAHOO.ext.Element |
Element |
Temporarily enables offsets (width,height,x,y) for an element with display:none, use endMeasure() when done. |
|
blur() : YAHOO.ext.Element |
Element |
Tries to blur the element. Any exceptions are caught. |
|
bufferedListener(String eventName , Function handler , [Object scope ], [Number millis ]) : Function |
Element |
Appends an event handler to this element that is buffered. If the event is triggered more than once
in the specified ... |
|
center([String/HTMLElement/YAHOO.ext.Element centerIn ]) : void |
Element |
Centers the Element in either the viewport, or another Element. |
|
clearOpacity() : YAHOO.ext.Element |
Element |
Clears any opacity settings from this element. Required in some cases for IE. |
|
clearPositioning() : YAHOO.ext.Element |
Element |
Clear positioning back to the default when the document was loaded |
|
clip() : YAHOO.ext.Element |
Element |
Store the current overflow setting and clip overflow on the element - use unclip to remove |
|
createChild(Object config , [HTMLElement insertBefore ]) : YAHOO.ext.Element |
Element |
Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child e... |
|
createProxy(String/Object config , [String/HTMLElement renderTo ], [Boolean matchBox ]) : YAHOO.ext.Element |
Element |
Creates a proxy element of this element |
|
createShim() : YAHOO.ext.Element |
Element |
Creates an iframe shim for this element to keep selects and other windowed objects from
showing through. |
|
enableDisplayMode([String display ]) : YAHOO.ext.Element |
Element |
Convenience method for setVisibilityMode(Element.DISPLAY) |
|
endMeasure() : YAHOO.ext.Element |
Element |
Restores displays to before beginMeasure was called |
|
fitToParent([Boolean monitorResize ]) : YAHOO.ext.Element |
Element |
Sizes this element to it's parent element's dimensions performing
neccessary box adjustments. |
|
focus() : YAHOO.ext.Element |
Element |
Tries to focus the element. Any exceptions are caught. |
|
get<static>(String/HTMLElement/Element el , [Boolean autoGenerateId ]) : Element |
Element |
<static> Static method to retreive Element objects. Uses simple caching to consistently return the same object.... |
|
getBorderWidth(String side ) : Number |
Element |
Gets the width of the border(s) for the specified side(s) |
|
getBottom(Boolean local ) : Number |
Element |
Gets the bottom Y coordinate of the element (element Y position + element height) |
|
getBox([Boolean contentBox ], [Boolean local ]) : Object |
Element |
Return a box {x, y, width, height} that can be used to set another elements
size/location to match this element. |
|
getCenterXY(Boolean offsetScroll ) : Array |
Element |
Calculates the x, y to center this element on the screen |
|
getChildrenByClassName(String className , [String tagName ]) : Array |
Element |
Gets an array of child YAHOO.ext.Element objects by class name and optional tagName |
|
getChildrenByTagName(String tagName ) : Array |
Element |
Gets an array of child YAHOO.ext.Element objects by tag name |
|
getHeight([Boolean contentHeight ]) : Number |
Element |
Returns the offset height of the element |
|
getLeft(Boolean local ) : Number |
Element |
Gets the left X coordinate |
|
getMargins([String sides ]) : Object/Number |
Element |
Returns an object with properties top, left, right and bottom representing the margins of this element unless sides i... |
|
getNextSibling() : HTMLElement |
Element |
Gets the next sibling, skipping text nodes |
|
getPadding(String side ) : Number |
Element |
Gets the width of the padding(s) for the specified side(s) |
|
getPositioning() : Object |
Element |
Gets an object with all CSS positioning properties. Useful along with setPostioning to get
snapshot before performin... |
|
getPrevSibling() : HTMLElement |
Element |
Gets the previous sibling, skipping text nodes |
|
getRegion() : Region |
Element |
Returns the region of the given element.
The element must be part of the DOM tree to have a region (display:none or e... |
|
getRight(Boolean local ) : Number |
Element |
Gets the right X coordinate of the element (element X position + element width) |
|
getSize([Boolean contentSize ]) : Object |
Element |
Returns the size of the element |
|
getStyle(String property ) : String |
Element |
Normalizes currentStyle and ComputedStyle. |
|
getTop(Boolean local ) : Number |
Element |
Gets the top Y coordinate |
|
getUpdateManager() : YAHOO.ext.UpdateManager |
Element |
Gets this elements UpdateManager |
|
getWidth([Boolean contentWidth ]) : Number |
Element |
Returns the offset width of the element |
|
getX() : void |
Element |
Gets the current X position of the element based on page coordinates. Element must be part of the DOM tree to have p... |
|
getXY() : void |
Element |
Gets the current position of the element based on page coordinates. Element must be part of the DOM tree to have pag... |
|
getY() : void |
Element |
Gets the current Y position of the element based on page coordinates. Element must be part of the DOM tree to have p... |
|
hasClass(String className ) : Boolean |
Element |
Checks if a CSS class is in use by the element. |
|
hide([Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Hide this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible. |
|
initDD(String group , Object config , Object overrides ) : YAHOO.util.DD |
Element |
Initializes a YAHOO.util.DD object for this element. |
|
initDDProxy(String group , Object config , Object overrides ) : YAHOO.util.DDProxy |
Element |
Initializes a YAHOO.util.DDProxy object for this element. |
|
initDDTarget(String group , Object config , Object overrides ) : YAHOO.util.DDTarget |
Element |
Initializes a YAHOO.util.DDTarget object for this element. |
|
insertAfter(String/HTMLElement/Element el ) : YAHOO.ext.Element |
Element |
Inserts this element after the passed element in the DOM |
|
insertBefore(String/HTMLElement/Element el ) : YAHOO.ext.Element |
Element |
Inserts this element before the passed element in the DOM |
|
insertHtml(String where , String html ) : YAHOO.ext.Element |
Element |
Inserts an html fragment into this element |
|
isBorderBox() : Boolean |
Element |
Tests various css rules/browsers to determine if this element uses a border box |
|
isDisplayed() : Boolean |
Element |
Returns true if display is not "none" |
|
isVisible([Boolean deep ]) : Boolean |
Element |
Checks whether the element is currently visible using both visibility and display properties. |
|
load(String/Function url , [String/Object params ], [Function callback ], [Boolean discardUrl ]) : YAHOO.ext.Element |
Element |
Direct access to the UpdateManager update() method (takes the same parameters). |
|
mon(String eventName , Function fn , [Object scope ], [boolean override ]) : Function |
Element |
Append a managed listener (shorthanded for addManagedListener) |
|
move(String direction , Number distance , [Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Move this element relative to it's current position. |
|
moveTo(Number x , Number y , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be... |
|
on(String eventName , Function handler , [Object scope ], [boolean override ]) : YAHOO.ext.Element |
Element |
Appends an event handler to this element (Same as addListener) |
|
radioClass(String className ) : YAHOO.ext.Element |
Element |
Adds the passed className to this element and removes the class from all siblings |
|
remove() : void |
Element |
Removes this element from the DOM and deletes it from the cache |
|
removeAllListeners() : YAHOO.ext.Element |
Element |
Removes all previous added listeners from this element |
|
removeClass(String/Array className ) : YAHOO.ext.Element |
Element |
Removes a CSS class from the element. |
|
removeListener(String sType , Function fn , Object scope ) : YAHOO.ext.Element |
Element |
Removes an event handler from this element |
|
repaint() : YAHOO.ext.Element |
Element |
Forces the browser to repaint this element |
|
replace(String/HTMLElement/Element el ) : YAHOO.ext.Element |
Element |
Replaces the passed element with this element |
|
replaceClass(String oldClassName , String newClassName ) : YAHOO.ext.Element |
Element |
Replaces a CSS class on the element with another. |
|
scrollIntoView([String/HTMLElement/Element container ]) : YAHOO.ext.Element |
Element |
Scrolls this element into view within the passed container. |
|
select(String selector , Boolean unique ) : CompositeElement/CompositeElementLite |
Element |
Selects child nodes based on the passed CSS selector (the selector should not contain an id) |
|
select<static>(String/Array selector , [Boolean unique ]) : CompositeElementLite/CompositeElement |
Element |
<static> Selects elements based on the passed CSS selector to enable working on them as 1. |
|
set(Object o ) : YAHOO.ext.Element |
Element |
Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function) |
|
setAbsolutePositioned([Number zIndex ]) : YAHOO.ext.Element |
Element |
Set the element as absolute positioned with the specified z-index |
|
setBottom(String bottom ) : YAHOO.ext.Element |
Element |
Set the element's css bottom style |
|
setBounds(Number x , Number y , Number width , Number height , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated c... |
|
setBox(Object box , [Boolean adjust ], [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x an... |
|
setDisplayed(Boolean value ) : YAHOO.ext.Element |
Element |
Sets the css display. Uses originalDisplay if value is a boolean true. |
|
setHeight(Number height , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the height of the element |
|
setLeft(String left ) : YAHOO.ext.Element |
Element |
Set the element's left position directly using CSS style (instead of setX()) |
|
setLeftTop() : YAHOO.ext.Element |
Element |
Quick set left and top adding default units |
|
setLocation(Number x , Number y , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be... |
|
setOpacity(Float opacity , [Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the opacity of the element |
|
setPositioning(Object posCfg ) : YAHOO.ext.Element |
Element |
Set positioning with an object returned by getPositioning(). |
|
setRegion(YAHOO.util.Region region , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the element's position and size the the specified region. If animation is true then width, height, x and y will ... |
|
setRelativePositioned([Number zIndex ]) : YAHOO.ext.Element |
Element |
Set the element as relative positioned with the specified z-index |
|
setRight(String right ) : YAHOO.ext.Element |
Element |
Set the element's css right style |
|
setSize(Number width , Number height , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the size of the element. If animation is true, both width an height will be animated concurrently. |
|
setStyle(String/Object property , [String val ]) : YAHOO.ext.Element |
Element |
Wrapper for setting style properties, also takes single object parameter of multiple styles |
|
setTop(String top ) : YAHOO.ext.Element |
Element |
Set the element's top position directly using CSS style (instead of setY()) |
|
setVisibilityMode(visMode Element.VISIBILITY ) : YAHOO.ext.Element |
Element |
Sets the elements visibility mode. When setVisible() is called it
will use this to determine whether to set the visib... |
|
setVisible(Boolean visible , [Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use
the d... |
|
setWidth(Number width , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the width of the element |
|
setX(Number The , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coor... |
|
setXY(Array pos , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be... |
|
setY(Number The , [Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coor... |
|
show([Boolean animate ], [Float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Show this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible. |
|
swallowEvent(String eventName , [Boolean preventDefault ]) : YAHOO.ext.Element |
Element |
Stops the specified event from bubbling and optionally prevent's the default action |
|
toggle([Boolean animate ], [float duration ], [Function onComplete ], [Function easing ]) : YAHOO.ext.Element |
Element |
Toggles the elements visibility or display, depending on visibility mode. |
|
toggleClass(String className ) : YAHOO.ext.Element |
Element |
Toggles (adds or removes) the passed class. |
|
unclip() : YAHOO.ext.Element |
Element |
Return clipping (overflow) to original clipping before clip() was called |
|
unselectable() : YAHOO.ext.Element |
Element |
Disables text selection for this element (normalized across browsers) |
|
update(String html , [Boolean loadScripts ], Function callback ) : YAHOO.ext.Element |
Element |
Update the innerHTML of this element, optionally searching for and processing scripts |
|
wrap([Object config ]) : Element |
Element |
Creates and wraps this element with another element |
This class has no public events.
addClass
public function addClass(String/Array className
)
Add a CSS class to the element.
This method is defined by Element.
addClassOnOver
public function addClassOnOver(String className
)
Sets up event handlers to add and remove a css class when the mouse is over this element
This method is defined by Element.
addHandler
public function addHandler(String eventName
, Boolean stopPropagation
, Function handler
, [Object scope
], [boolean override
])
Appends an event handler to this element. The difference between this function and addListener is this
function prevents the default action, and if set stops propagation (bubbling) as well
Parameters:
eventName
: StringThe type of event to listen for
stopPropagation
: BooleanWhether to also stopPropagation (bubbling)
handler
: FunctionThe method the event invokes
scope
: Object(optional) An arbitrary object that will be passed as a parameter to the handler
override
: boolean(optional) If true, the obj passed in becomes the execution scope of the listener
Returns:
This method is defined by Element.
addKeyListener
public function addKeyListener(Number/Array/Object/String key
, Function fn
, [Object scope
])
Convenience method for constructing a KeyMap
Parameters:
key
: Number/Array/Object/StringEither a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options: {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
fn
: FunctionThe function to call
scope
: Object(optional) The scope of the function
Returns:
YAHOO.ext.KeyMap
The KeyMap created
This method is defined by Element.
addKeyMap
public function addKeyMap(Object config
)
Creates a KeyMap for this element
Parameters:
Returns:
YAHOO.ext.KeyMap
The KeyMap created
This method is defined by Element.
addListener
public function addListener(String eventName
, Function handler
, [Object scope
], [boolean override
])
Appends an event handler to this element
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) An arbitrary object that will be passed as a parameter to the handler
override
: boolean(optional) If true, the obj passed in becomes the execution scope of the listener
Returns:
This method is defined by Element.
addManagedListener
public function addManagedListener(String eventName
, Function fn
, [Object scope
], [boolean override
])
Append a managed listener - See
YAHOO.ext.EventObject for more details. Use mon() for a shorter version.
Parameters:
eventName
: StringThe type of event to listen for
fn
: FunctionThe method the event invokes
scope
: Object(optional) An arbitrary object that will be passed as a parameter to the handler
override
: boolean(optional) If true, the obj passed in becomes the execution scope of the listener
Returns:
This method is defined by Element.
alignTo
public function alignTo(String/HTMLElement/YAHOO.ext.Element element
, String position
, [Array offsets
], [Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Align this element with another element.
Parameters:
element
: String/HTMLElement/YAHOO.ext.ElementThe element to align to.
position
: StringThe position to align to. Possible values are 'tl' - top left, 'tr' - top right, 'bl' - bottom left, and 'br' - bottom right.
offsets
: Array(optional) Offset the positioning by [x, y]
animate
: Boolean(optional) Animate the movement (Default is false)
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use.
Returns:
This method is defined by Element.
animate
public function animate(Object args
, [Float duration
], [Function onComplete
], [Function easing
], [Function animType
])
Perform Yahoo UI animation on this element.
Parameters:
args
: ObjectThe YUI animation control args
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
animType
: Function(optional) YAHOO.util.Anim subclass to use. For example: YAHOO.util.Motion
Returns:
This method is defined by Element.
appendChild
public function appendChild(String/HTMLElement/Array/Element/CompositeElement el
)
Appends the passed element(s) to this element
Parameters:
el
: String/HTMLElement/Array/Element/CompositeElement
Returns:
This method is defined by Element.
appendTo
public function appendTo(String/HTMLElement/Element el
)
Appends this element to the passed element
Parameters:
el
: String/HTMLElement/ElementThe new parent element
Returns:
This method is defined by Element.
applyStyles
public function applyStyles(String/Object/Function styles
)
More flexible version of
setStyle for setting style properties.
This method is defined by Element.
autoHeight
public function autoHeight([Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Measures the elements content height and updates height to match. Note, this function uses setTimeout and
the new height may not be available immediately.
Parameters:
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: Float(optional) Length of the animation. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut for hiding or YAHOO.util.Easing.easeIn for showing)
Returns:
This method is defined by Element.
beginMeasure
public function beginMeasure()
Temporarily enables offsets (width,height,x,y) for an element with display:none, use endMeasure() when done.
This method is defined by Element.
blur
public function blur()
Tries to blur the element. Any exceptions are caught.
This method is defined by Element.
bufferedListener
public function bufferedListener(String eventName
, Function handler
, [Object scope
], [Number millis
])
Appends an event handler to this element that is buffered. If the event is triggered more than once
in the specified time-frame, only the last one actually fires.
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) The scope (this object) for the handler
millis
: Number(optional) The number of milliseconds to buffer (defaults to 250)
Returns:
This method is defined by Element.
center
public function center([String/HTMLElement/YAHOO.ext.Element centerIn
])
Centers the Element in either the viewport, or another Element.
This method is defined by Element.
clearOpacity
public function clearOpacity()
Clears any opacity settings from this element. Required in some cases for IE.
This method is defined by Element.
clearPositioning
public function clearPositioning()
Clear positioning back to the default when the document was loaded
This method is defined by Element.
clip
public function clip()
Store the current overflow setting and clip overflow on the element - use
unclip to remove
This method is defined by Element.
createChild
public function createChild(Object config
, [HTMLElement insertBefore
])
Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child element.
Parameters:
Returns:
YAHOO.ext.Element
The new child element
This method is defined by Element.
createProxy
public function createProxy(String/Object config
, [String/HTMLElement renderTo
], [Boolean matchBox
])
Creates a proxy element of this element
Parameters:
config
: String/ObjectThe class name of the proxy element or a DomHelper config object
renderTo
: String/HTMLElement(optional) The element or element id to render the proxy to (defaults to document.body)
matchBox
: Boolean(optional) True to align and size the proxy to this element now (defaults to false)
Returns:
YAHOO.ext.Element
The new proxy element
This method is defined by Element.
createShim
public function createShim()
Creates an iframe shim for this element to keep selects and other windowed objects from
showing through.
Parameters:
Returns:
YAHOO.ext.Element
The new shim element
This method is defined by Element.
enableDisplayMode
public function enableDisplayMode([String display
])
Convenience method for setVisibilityMode(Element.DISPLAY)
This method is defined by Element.
endMeasure
public function endMeasure()
Restores displays to before beginMeasure was called
This method is defined by Element.
fitToParent
public function fitToParent([Boolean monitorResize
])
Sizes this element to it's parent element's dimensions performing
neccessary box adjustments.
This method is defined by Element.
focus
public function focus()
Tries to focus the element. Any exceptions are caught.
This method is defined by Element.
get<static>
public function get<static>(String/HTMLElement/Element el
, [Boolean autoGenerateId
])
<static> Static method to retreive Element objects. Uses simple caching to consistently return the same object.
Automatically fixes if an object was recreated with the same id via AJAX or DOM.
Parameters:
el
: String/HTMLElement/ElementThe id of the element or the element to wrap (must have an id). If you pass in an element, it is returned
autoGenerateId
: Boolean(optional) Set this flag to true if you are passing an element without an id (like document.body). It will auto generate an id if one isn't present.
Returns:
Element
The element object
This method is defined by Element.
getBorderWidth
public function getBorderWidth(String side
)
Gets the width of the border(s) for the specified side(s)
Parameters:
side
: StringCan be t, l, r, b or any combination of those to add multiple values. For example, passing lr would get the border (l)eft width + the border (r)ight width.
Returns:
This method is defined by Element.
getBottom
public function getBottom(Boolean local
)
Gets the bottom Y coordinate of the element (element Y position + element height)
This method is defined by Element.
getBox
public function getBox([Boolean contentBox
], [Boolean local
])
Return a box {x, y, width, height} that can be used to set another elements
size/location to match this element.
This method is defined by Element.
getCenterXY
public function getCenterXY(Boolean offsetScroll
)
Calculates the x, y to center this element on the screen
Parameters:
Returns:
Array
The x, y values [x, y]
This method is defined by Element.
getChildrenByClassName
public function getChildrenByClassName(String className
, [String tagName
])
Gets an array of child YAHOO.ext.Element objects by class name and optional tagName
Parameters:
className
: StringtagName
: String(optional)
Returns:
This method is defined by Element.
getChildrenByTagName
public function getChildrenByTagName(String tagName
)
Gets an array of child YAHOO.ext.Element objects by tag name
This method is defined by Element.
getHeight
public function getHeight([Boolean contentHeight
])
Returns the offset height of the element
Parameters:
Returns:
Number
The element's height
This method is defined by Element.
getLeft
public function getLeft(Boolean local
)
Gets the left X coordinate
This method is defined by Element.
getMargins
public function getMargins([String sides
])
Returns an object with properties top, left, right and bottom representing the margins of this element unless sides is passed,
then it returns the calculated width of the sides (see getPadding)
This method is defined by Element.
getNextSibling
public function getNextSibling()
Gets the next sibling, skipping text nodes
Parameters:
Returns:
HTMLElement
The next sibling or null
This method is defined by Element.
getPadding
public function getPadding(String side
)
Gets the width of the padding(s) for the specified side(s)
Parameters:
side
: StringCan be t, l, r, b or any combination of those to add multiple values. For example, passing lr would get the padding (l)eft + the padding (r)ight.
Returns:
This method is defined by Element.
getPositioning
public function getPositioning()
Gets an object with all CSS positioning properties. Useful along with setPostioning to get
snapshot before performing an update and then restoring the element.
This method is defined by Element.
getPrevSibling
public function getPrevSibling()
Gets the previous sibling, skipping text nodes
This method is defined by Element.
getRegion
public function getRegion()
Returns the region of the given element.
The element must be part of the DOM tree to have a region (display:none or elements not appended return false).
This method is defined by Element.
getRight
public function getRight(Boolean local
)
Gets the right X coordinate of the element (element X position + element width)
This method is defined by Element.
getSize
public function getSize([Boolean contentSize
])
Returns the size of the element
This method is defined by Element.
getStyle
public function getStyle(String property
)
Normalizes currentStyle and ComputedStyle.
This method is defined by Element.
getTop
public function getTop(Boolean local
)
Gets the top Y coordinate
This method is defined by Element.
getUpdateManager
public function getUpdateManager()
Gets this elements UpdateManager
Parameters:
Returns:
YAHOO.ext.UpdateManager
The UpdateManager
This method is defined by Element.
getWidth
public function getWidth([Boolean contentWidth
])
Returns the offset width of the element
Parameters:
Returns:
Number
The element's width
This method is defined by Element.
getX
public function getX()
Gets the current X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
@ return {Number} The X position of the element
This method is defined by Element.
getXY
public function getXY()
Gets the current position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
@ return {Array} The XY position of the element
This method is defined by Element.
getY
public function getY()
Gets the current Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
@ return {Number} The Y position of the element
This method is defined by Element.
hasClass
public function hasClass(String className
)
Checks if a CSS class is in use by the element.
Parameters:
className
: StringThe CSS class to check
Returns:
This method is defined by Element.
hide
public function hide([Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Hide this element - Uses display mode to determine whether to use "display" or "visibility". See
setVisible.
Parameters:
animate
: Boolean(optional) Animate (fade) the transition (Default is false)
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
initDD
public function initDD(String group
, Object config
, Object overrides
)
Initializes a YAHOO.util.DD object for this element.
Parameters:
Returns:
YAHOO.util.DD
The DD object
This method is defined by Element.
initDDProxy
public function initDDProxy(String group
, Object config
, Object overrides
)
Initializes a YAHOO.util.DDProxy object for this element.
Parameters:
group
: StringThe group the DDProxy object is member of
config
: ObjectThe DDProxy config object
overrides
: ObjectAn object containing methods to override/implement on the DDProxy object
Returns:
YAHOO.util.DDProxy
The DDProxy object
This method is defined by Element.
initDDTarget
public function initDDTarget(String group
, Object config
, Object overrides
)
Initializes a YAHOO.util.DDTarget object for this element.
Parameters:
group
: StringThe group the DDTarget object is member of
config
: ObjectThe DDTarget config object
overrides
: ObjectAn object containing methods to override/implement on the DDTarget object
Returns:
YAHOO.util.DDTarget
The DDTarget object
This method is defined by Element.
insertAfter
public function insertAfter(String/HTMLElement/Element el
)
Inserts this element after the passed element in the DOM
This method is defined by Element.
insertBefore
public function insertBefore(String/HTMLElement/Element el
)
Inserts this element before the passed element in the DOM
This method is defined by Element.
insertHtml
public function insertHtml(String where
, String html
)
Inserts an html fragment into this element
Parameters:
where
: StringWhere to insert the html in relation to the this element - beforeBegin, afterBegin, beforeEnd, afterEnd.
html
: StringThe HTML fragment
Returns:
This method is defined by Element.
isBorderBox
public function isBorderBox()
Tests various css rules/browsers to determine if this element uses a border box
This method is defined by Element.
isDisplayed
public function isDisplayed()
Returns true if display is not "none"
This method is defined by Element.
isVisible
public function isVisible([Boolean deep
])
Checks whether the element is currently visible using both visibility and display properties.
This method is defined by Element.
load
public function load(String/Function url
, [String/Object params
], [Function callback
], [Boolean discardUrl
])
Direct access to the UpdateManager update() method (takes the same parameters).
Parameters:
url
: String/FunctionThe url for this request or a function to call to get the url
params
: String/Object(optional) The parameters to pass as either a url encoded string "param1=1¶m2=2" or an object {param1: 1, param2: 2}
callback
: Function(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
discardUrl
: Boolean(optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.
Returns:
This method is defined by Element.
mon
public function mon(String eventName
, Function fn
, [Object scope
], [boolean override
])
Append a managed listener (shorthanded for
addManagedListener)
Parameters:
eventName
: StringThe type of event to listen for
fn
: FunctionThe method the event invokes
scope
: Object(optional) An arbitrary object that will be passed as a parameter to the handler
override
: boolean(optional) If true, the obj passed in becomes the execution scope of the listener
Returns:
This method is defined by Element.
move
public function move(String direction
, Number distance
, [Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Move this element relative to it's current position.
Parameters:
direction
: StringPossible values are: 'l','left' - 'r','right' - 't','top','up' - 'b','bottom','down'.
distance
: NumberHow far to move the element in pixels
animate
: Boolean(optional) Animate the movement (Default is false)
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use.
Returns:
This method is defined by Element.
moveTo
public function moveTo(Number x
, Number y
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
Parameters:
x
: NumberX value for new position (coordinates are page-based)
y
: NumberY value for new position (coordinates are page-based)
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
on
public function on(String eventName
, Function handler
, [Object scope
], [boolean override
])
Appends an event handler to this element (Same as addListener)
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) An arbitrary object that will be passed as a parameter to the handler
override
: boolean(optional) If true, the obj passed in becomes the execution scope of the listener
Returns:
This method is defined by Element.
radioClass
public function radioClass(String className
)
Adds the passed className to this element and removes the class from all siblings
Parameters:
className
: StringThe className to add
Returns:
This method is defined by Element.
remove
public function remove()
Removes this element from the DOM and deletes it from the cache
This method is defined by Element.
removeAllListeners
public function removeAllListeners()
Removes all previous added listeners from this element
This method is defined by Element.
removeClass
public function removeClass(String/Array className
)
Removes a CSS class from the element.
This method is defined by Element.
removeListener
public function removeListener(String sType
, Function fn
, Object scope
)
Removes an event handler from this element
This method is defined by Element.
repaint
public function repaint()
Forces the browser to repaint this element
This method is defined by Element.
replace
public function replace(String/HTMLElement/Element el
)
Replaces the passed element with this element
Parameters:
el
: String/HTMLElement/ElementThe element to replace
Returns:
This method is defined by Element.
replaceClass
public function replaceClass(String oldClassName
, String newClassName
)
Replaces a CSS class on the element with another.
This method is defined by Element.
scrollIntoView
public function scrollIntoView([String/HTMLElement/Element container
])
Scrolls this element into view within the passed container.
This method is defined by Element.
select
public function select(String selector
, Boolean unique
)
Selects child nodes based on the passed CSS selector (the selector should not contain an id)
Parameters:
Returns:
CompositeElement/CompositeElementLite
The composite element
This method is defined by Element.
select<static>
public function select<static>(String/Array selector
, [Boolean unique
])
<static> Selects elements based on the passed CSS selector to enable working on them as 1.
Parameters:
Returns:
CompositeElementLite/CompositeElement
This method is defined by Element.
set
public function set(Object o
)
Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function)
This method is defined by Element.
setAbsolutePositioned
public function setAbsolutePositioned([Number zIndex
])
Set the element as absolute positioned with the specified z-index
Parameters:
zIndex
: Number(optional)
Returns:
This method is defined by Element.
setBottom
public function setBottom(String bottom
)
Set the element's css bottom style
This method is defined by Element.
setBounds
public function setBounds(Number x
, Number y
, Number width
, Number height
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.
Parameters:
x
: NumberX value for new position (coordinates are page-based)
y
: NumberY value for new position (coordinates are page-based)
width
: NumberThe new width
height
: NumberThe new height
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setBox
public function setBox(Object box
, [Boolean adjust
], [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.
Parameters:
box
: ObjectThe box to fill {x, y, width, height}
adjust
: Boolean(optional) Whether to adjust for box-model issues automatically
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setDisplayed
public function setDisplayed(Boolean value
)
Sets the css display. Uses originalDisplay if value is a boolean true.
This method is defined by Element.
setHeight
public function setHeight(Number height
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the height of the element
Parameters:
height
: NumberThe new height
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut if height is larger or YAHOO.util.Easing.easeIn if it is smaller)
Returns:
This method is defined by Element.
setLeft
public function setLeft(String left
)
Set the element's left position directly using CSS style (instead of setX())
This method is defined by Element.
setLeftTop
public function setLeftTop()
Quick set left and top adding default units
This method is defined by Element.
setLocation
public function setLocation(Number x
, Number y
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
Parameters:
x
: NumberX value for new position (coordinates are page-based)
y
: NumberY value for new position (coordinates are page-based)
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setOpacity
public function setOpacity(Float opacity
, [Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Set the opacity of the element
Parameters:
opacity
: FloatThe new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
animate
: Boolean(optional) Animate (fade) the transition (Default is false)
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut if height is larger or YAHOO.util.Easing.easeIn if it is smaller)
Returns:
This method is defined by Element.
setPositioning
public function setPositioning(Object posCfg
)
Set positioning with an object returned by getPositioning().
This method is defined by Element.
setRegion
public function setRegion(YAHOO.util.Region region
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Sets the element's position and size the the specified region. If animation is true then width, height, x and y will be animated concurrently.
Parameters:
region
: YAHOO.util.RegionThe region to fill
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setRelativePositioned
public function setRelativePositioned([Number zIndex
])
Set the element as relative positioned with the specified z-index
Parameters:
zIndex
: Number(optional)
Returns:
This method is defined by Element.
setRight
public function setRight(String right
)
Set the element's css right style
This method is defined by Element.
setSize
public function setSize(Number width
, Number height
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the size of the element. If animation is true, both width an height will be animated concurrently.
Parameters:
width
: NumberThe new width
height
: NumberThe new height
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setStyle
public function setStyle(String/Object property
, [String val
])
Wrapper for setting style properties, also takes single object parameter of multiple styles
This method is defined by Element.
setTop
public function setTop(String top
)
Set the element's top position directly using CSS style (instead of setY())
This method is defined by Element.
setVisibilityMode
public function setVisibilityMode(visMode Element.VISIBILITY
)
Sets the elements visibility mode. When setVisible() is called it
will use this to determine whether to set the visibility or the display property.
Parameters:
Element.VISIBILITY
: visModeor Element.DISPLAY
Returns:
This method is defined by Element.
setVisible
public function setVisible(Boolean visible
, [Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use
the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the visibility property.
Parameters:
visible
: BooleanWhether the element is visible
animate
: Boolean(optional) Fade the element in or out (Default is false)
duration
: Float(optional) How long the fade effect lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut for hiding or YAHOO.util.Easing.easeIn for showing)
Returns:
This method is defined by Element.
setWidth
public function setWidth(Number width
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the width of the element
Parameters:
width
: NumberThe new width
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut if width is larger or YAHOO.util.Easing.easeIn if it is smaller)
Returns:
This method is defined by Element.
setX
public function setX(Number The
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
Parameters:
The
: NumberX position of the element
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setXY
public function setXY(Array pos
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Set the position of the element in page coordinates, regardless of how the element is positioned.
The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
Parameters:
pos
: ArrayContains X & Y [x, y] values for new position (coordinates are page-based)
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
setY
public function setY(Number The
, [Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
Parameters:
The
: NumberY position of the element
animate
: Boolean(optional) Animate the transition (Default is false)
duration
: float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
show
public function show([Boolean animate
], [Float duration
], [Function onComplete
], [Function easing
])
Show this element - Uses display mode to determine whether to use "display" or "visibility". See
setVisible.
Parameters:
animate
: Boolean(optional) Animate (fade in) the transition (Default is false)
duration
: Float(optional) How long the animation lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeBoth)
Returns:
This method is defined by Element.
swallowEvent
public function swallowEvent(String eventName
, [Boolean preventDefault
])
Stops the specified event from bubbling and optionally prevent's the default action
This method is defined by Element.
toggle
public function toggle([Boolean animate
], [float duration
], [Function onComplete
], [Function easing
])
Toggles the elements visibility or display, depending on visibility mode.
Parameters:
animate
: Boolean(optional) Fade the element in or out (Default is false)
duration
: float(optional) How long the fade effect lasts. (Defaults to .35 seconds)
onComplete
: Function(optional) Function to call when animation completes.
easing
: Function(optional) YAHOO.util.Easing method to use. (Defaults to YAHOO.util.Easing.easeOut for hiding or YAHOO.util.Easing.easeIn for showing)
Returns:
This method is defined by Element.
toggleClass
public function toggleClass(String className
)
Toggles (adds or removes) the passed class.
This method is defined by Element.
unclip
public function unclip()
Return clipping (overflow) to original clipping before clip() was called
This method is defined by Element.
unselectable
public function unselectable()
Disables text selection for this element (normalized across browsers)
This method is defined by Element.
update
public function update(String html
, [Boolean loadScripts
], Function callback
)
Update the innerHTML of this element, optionally searching for and processing scripts
This method is defined by Element.
wrap
public function wrap([Object config
])
Creates and wraps this element with another element
This method is defined by Element.