Definition
Namespace:Telerik.Web
Inheritance: Telerik.Web.CommonScripts
Methods
Adds multiple css classes to a DomElement
static addCssClasses(Element element, Array classNames): void
The element to modify
classNamesArrayThe class names to add
Adds the specified event handler to the element's eventName. Can be used when attaching events to HTML elements in IFRAMEs where ASP.NET AJAX's $addHandler and $removeHandler do not work
static addExternalHandler(Element element, String eventName, Function handler): void
The HTML DOM element to attach an event handler to
eventNameStringThe name of the event to attach an event handler to
handlerFunctionThe event handler function
Provides a method to add a DOM event handler to the DOM element that exposes the event. This member is static and can be invoked without creating an instance of the class. This is basically a copy of $addHandler, but handles correctly IE proprietary events, such as "onpropertychange", in IE9.
static addHandler(Element element, String eventName, Function handler, Boolean autoRemove): void
The HTML DOM element to attach an event handler to
eventNameStringThe name of the event to attach an event handler to
handlerFunctionThe event handler function
autoRemoveBooleanA boolean value that determines whether the handler should be removed automatically when the element is disposed.
Adds a list of DOM event handlers to the DOM element that exposes the events. This member is static and can be invoked without creating an instance of the class. This is basically a copy of $addHandlers, but handles correctly IE proprietary events, such as "onpropertychange", in IE9.
static addHandlers(Element element, Object events, Object handlerOwner, Boolean autoRemove): void
The DOM element that exposes the events.
eventsObjectA dictionary of event handlers.
handlerOwnerObjectThe object instance that is the context for the delegates that should be created from the handlers.
autoRemoveBooleanA boolean value that determines whether the handler should be removed automatically when the element is disposed.
Cancels the specified event from propagating
static cancelRawEvent(Sys.UI.DomEvent e): Boolean
The event object of the event to cancel
Returns:Boolean
Always returns false
Removes all DOM event handlers from a DOM element that were added through the Sys.UI.DomEvent addHandler or the Sys.UI.DomEvent addHandlers methods. This member is static and can be invoked without creating an instance of the class. This is basically a copy of $clearHandlers, but handles correctly IE proprietary events, such as "onpropertychange", in IE9.
static clearHandlers(Element element): void
The element that exposes the events.
Clones the specified sourceControl RadControl client object with the optional specified type and saves it as an attribute to the HTML element representing the container DOM element of the RadControl
static cloneControl(Telerik.Web.UI.RadWebControl sourceControl, Function optionalType, Element element): Telerik.Web.UI.RadWebControl
Source RadControl object to clone
optionalTypeFunctionOptional. The type of the cloned control
elementElementThe HTML DOM element of the cloned control
Returns:Telerik.Web.UI.RadWebControl
The cloned RadWebControl object
Clones the source object to the target object and returns the cloned target object
static cloneJsObject(Object source, Object target): Object
The source JS object
targetObjectOptional. The target JS object
Returns:Object
The cloned JS object
Tests whether a point (x,y) is contained within a rectangle
static containsPoint(Object rect, Number x, Number y): void
The rectangle
xNumberThe x coordinate of the point
yNumberThe y coordinate of the point
Checks if the specified HTML element overflows the screen with the specified screen size from bottom
static elementOverflowsBottom(Object screenSize, Element element, Sys.UI.Point cachedLocation): Boolean
An Object
elementElementHTML DOM element
cachedLocationSys.UI.PointOptional. If a Point object is specified for this parameter
Returns:Boolean
Checks if the specified HTML element overflows the screen with the specified screen size from left
static elementOverflowsLeft(Element element, Sys.UI.Point cachedLocation): Boolean
HTML DOM element
cachedLocationSys.UI.PointOptional. If a Point object is specified for this parameter
Returns:Boolean
Checks if the specified HTML element overflows the screen with the specified screen size from right
static elementOverflowsRight(Object screenSize, Element element, Sys.UI.Point cachedLocation): Boolean
An Object
elementElementHTML DOM element
cachedLocationSys.UI.PointOptional. If a Point object is specified for this parameter
Returns:Boolean
Checks if the specified HTML element overflows the screen with the specified screen size from top
static elementOverflowsTop(Element element, Sys.UI.Point cachedLocation): Boolean
HTML DOM element
cachedLocationSys.UI.PointOptional. If a Point object is specified for this parameter
Returns:Boolean
Finds the client-side RadControl object by provided server-side ID of the RadControl object in the collection of child elements of the parent DOM element
static findControl(Element parent, String id): Sys.UI.Control
The HTML DOM element that is a parent to the container element of the control to find
idStringThe ID of the control to find
Returns:Sys.UI.Control
Finds the HTML DOM wrapper element of the RadControl by provided server-side ID in the collection of child elements of the parent DOM element
static findElement(Element parent, String id): Element
The HTML DOM element that is a parent to the container element of the control to find
idStringThe ID of the control to find
Returns:Element
Finds the closest scrollable parent element and changes its position to relative if static
static fixScrollableParentBehavior_OldIE(Element element): void
HTML DOM element
Gets the entire border box sizes.
static getBorderBox(Element element): Object
DOM element
Returns:Object
Element
Gets the border thickness of an element on a specific boxSide.
static getBorderWidth(Element element, Telerik.Web.BoxSide boxSide): Number
DOM element
boxSideTelerik.Web.BoxSideSide of the element
Returns:Number
Border thickness on the element
Gets the coordinates, width and height of an element.
static getBounds(Element element): Sys.UI.Bounds
HTML DOM element whose bounds to retrieve
Returns:Sys.UI.Bounds
A Bounds object with four fields
Returns the first child element of element with the specified className, optionally starting from position index
static getChildByClassName(Element element, String className, Number index): Element
HTML DOM element whose children to search in
classNameStringThe class name of the child element to search for
indexNumberThe index of the child element in the parent
Returns:Element
Returns an array of all child elements of element with the specified className
static getChildrenByClassName(Element element, String tagName): Array
HTML DOM element whose children to search in
tagNameStringThe tag name of the child elements to search for
Returns:Array
Returns an array of all child elements of element with the specified tag name
static getChildrenByTagName(Element element, String tagName): Array
HTML DOM element whose children to search in
tagNameStringThe tag name of the child elements to search for
Returns:Array
Gets the width and height of the browser client window (excluding scrollbars)
static getClientBounds(): Sys.UI.Bounds
Sys.UI.Bounds
Browser
Gets the computed value of the attribute style of the specified element. If there's no computed value, optionally returns defaultValue
static getComputedStyle(Element element, String attribute, String defaultValue): String
HTML DOM element whose style to retrieve
attributeStringThe style attribute whose value to retrieve
defaultValueStringOptional. The default value to return if there is no value set
Returns:String
The value of the specified style attribute
Gets the "content-box" size of an element.
static getContentSize(Element element): Object
DOM element
Returns:Object
Size of the element
Gets the current value of the attribute style of the specified element. If the current value is not defined, optionally returns defaultValue
static getCurrentStyle(Element element, String attribute, String defaultValue): String
HTML DOM element whose style to retrieve
attributeStringThe style attribute whose value to retrieve
defaultValueStringOptional. The default value to return if there is no value set
Returns:String
The value of the specified style attribute
Gets the cursor position as Object {left, top} of the mouse when event e is fired, relative to the Document
static getDocumentRelativeCursorPosition(Sys.UI.DomEvent e): Object
The event object of the current DOM event
Returns:Object
Object
Returns the first child element of element widh the specified className and optionally of type tagName
static getElementByClassName(Element element, String className, String tagName): Element
The parent HTML DOM element
classNameStringThe class name of the element to retrieve
tagNameStringOptional. The tag name of the element to retrieve
Returns:Element
Returns the first child of element with the specified tagName, starting from index in the collection of child elements
static getFirstChildByTagName(Element element, String tagName, Number index): Element
HTML DOM element whose children to search in
tagNameStringThe tag name of the child element to search for
indexNumberThe index of the child element in the parent
Returns:Element
Returns the closest parent of element that has its display style set to "none", or null if no such parent is found
static getInvisibleParent(Element element): Element
HTML DOM element
Returns:Element
The first invisible parent HTML element
Returns the absolute location of element in the document
static getLocation(Element element): Sys.UI.Point
The HTML DOM element whose position to retrieve
Returns:Sys.UI.Point
A Point object contaning the location of the specified element
Gets the margin thickness of an element on a specific boxSide.
static getMargin(Element element, Telerik.Web.BoxSide boxSide): Number
DOM element
boxSideTelerik.Web.BoxSideSide of the element
Returns:Number
Margin thickness on the element
Gets the entire margin box sizes.
static getMarginBox(Element element): Object
DOM element
Returns:Object
Element
Gets the next non-text HTML sibling of element
static getNextHtmlNode(Element element): Element
HTML DOM element whose previous sibling to retrieve
Returns:Element
Returns the outer bounds of an HTML DOM element
static getOuterBounds(Element element): Sys.UI.Bounds
HTML DOM element
Returns:Sys.UI.Bounds
An object containing the outer bounds of element
Returns the outer HTML text of an element (element's innerHTML and its own rendered HTML)
static getOuterHtml(Element element): String
The HTML DOM element whose outer HTML text to retrieve
Returns:String
Returns the outer size of an HTML DOM element
static getOuterSize(Element element): Object
HTML DOM element
Returns:Object
An object containing width and height of element
Gets the padding thickness of an element on a specific boxSide.
static getPadding(Element element, Telerik.Web.BoxSide boxSide): Number
DOM element
boxSideTelerik.Web.BoxSideSide of the element
Returns:Number
Padding on the element
Gets the entire padding box sizes.
static getPaddingBox(Element element): Object
DOM element
Returns:Object
Element
Gets the previous non-text HTML sibling of element
static getPreviousHtmlNode(Element element): Element
HTML DOM element whose previous sibling to retrieve
Returns:Element
Returns the closest scrollable parent element or null if no such is found.
static getScrollableParent(Element element): Element
HTML DOM element
Returns:Element
Returns an array of all scrollable parent elements or an empty array if но such are found.
static getScrollableParents(Element element): Array
HTML DOM element
Returns:Array
Returns the scroll ofset of element from its parent(s). If recursive, return the absolute scroll offset
static getScrollOffset(Element element, Boolean recursive): Sys.UI.Point
The HTML DOM element whose scroll offset to find
recursiveBooleanIndicates whether to retrieve the scroll ofset of the element recursively. If true
Returns:Sys.UI.Point
Gets the "border-box" size of an element.
static getSize(Element element): Object
DOM element
Returns:Object
Size of the element
Returns the effective size of the client viewport as Object {width, height}
static getViewPortSize(): Object
Object
An Object
Returns true if element is visible, otherwise returns false
static getVisible(Element element): Boolean
HTML DOM element whose state to retrieve
Returns:Boolean
Gets whether the current border style for an element on a specific boxSide is not "none".
static isBorderVisible(Element element, Telerik.Web.BoxSide boxSide): Boolean
DOM element
boxSideTelerik.Web.BoxSideSide of the element
Returns:Boolean
Whether the current border style for an element on a specific boxSide is not
Whether the specified element is a descendant of the ancestor
static isDescendant(Element ancestor, Element descendant): void
Ancestor node
descendantElementPossible descendant node
Whether the specified element is a descendant of the ancestor or the same as the ancestor
static isDescendantOrSelf(Element ancestor, Element descendant): void
Ancestor node
descendantElementPossible descendant node
Returns Boolean value that indicates whether the page is opened under IE.
isIE(): Boolean
Boolean
Returns whether mouse is over element when event fires. See also isMouseOverElementEx
static isMouseOverElement(Element element, Sys.UI.DomEvent e): Boolean
HTML DOM element
eSys.UI.DomEventThe event object of the current DOM event
Returns:Boolean
Returns whether mouse is over element when event fires. This method is more sophisticated and it is recommend that you use it instead of isMouseOverElement, which exists for historical reasons.
static isMouseOverElementEx(Element element, Sys.UI.DomEvent e): Boolean
HTML DOM element
eSys.UI.DomEventThe event object of the current DOM event
Returns:Boolean
Returns Boolean value that indicates whether the page is opened under Opera.
isOpera(): Boolean
Boolean
Returns true if element is in RTL direction, otherwise returns false
static isRightToLeft(Element element): Boolean
HTML DOM element
Returns:Boolean
Returns Boolean value that indicates whether the page is opened under Safari.
isSafari(): Boolean
Boolean
Returns Boolean value that indicates whether the page is opened under a Mobile Device.
isTouchDevice(): Boolean
Boolean
Merges the atributes of source to target. If under IE, the optional preserve specifies whether to preserve the identity of target or to allow modification on merging
static mergeElementAttributes(Element oSource, Element oTarget, Boolean bPreserve): void
Source HTML element
oTargetElementTarget HTML element
bPreserveBooleanWhen in IE
Parses a border-width string into a pixel size
static parseBorderWidth(String borderWidth): Number
Type of border
Returns:Number
Number of pixels in the border
Parses a padding string into a pixel size
static parsePadding(String padding): Number
Padding to parse
Returns:Number
Number of pixels in the padding
Parses a unit string into a unit object
static parseUnit(String value): Object
Value to parse
Returns:Object
Parsed unit
Registers all link style tags in element to the page. If no element is provided, all the link tags on page are registered
static registerSkins(Element element): void
HTML DOM element contaning the links
Removes multiple css classes to a DomElement
static removeCssClasses(Element element, Array classNames): void
The element to modify
classNamesArrayThe class names to remove
Removes the event handler from an element's event. Can be used when attaching events to HTML elements in IFRAMEs where ASP.NET AJAX's $addHandler and $removeHandler do not work
static removeExternalHandler(Element element, String eventName, Function handler): void
The HTML DOM element to attach an event handler to
eventNameStringThe name of the event to attach an event handler to
handlerFunctionThe event handler function
Removes a DOM event handler from the DOM element that exposes the event. This member is static and can be invoked without creating an instance of the class. This is basically a copy of $removeHandler, but handles correctly IE proprietary events, such as "onpropertychange", in IE9.
static removeHandler(Element element, String eventName, Function handler): void
The element that exposes the event.
eventNameStringThe name of the event.
handlerFunctionThe event handler to remove.
Repaints all children elements of an element or a control's container
static repaintChildren(Object parent): void
Scrolls the parent scrollable container to element's position. An alternative flicker-free implementation to HTMLDomElement.scrollIntoView()
static scrollIntoView(Element element): void
HTML DOM element to scroll into view
Sets the "border-box" bounds of an element
static setBounds(Element element, Object bounds): void
DOM element
boundsObjectBounds of the element
Sets the "content-box" size of an element.
static setContentSize(Element element, Object size): void
DOM element
sizeObjectSize of the element
Sets the location (left, top) of element to point (x, y)
static setLocation(Element element, Sys.UI.Point point): void
The HTML DOM element whose location to set
pointSys.UI.PointThe Point object contaning the position values
Sets the "border-box" size of an element.
static setSize(Element element, Object size): void
DOM element
sizeObjectSize of the element
Set the visibility of an element
static setVisible(Element element, Boolean value): void
The HTML DOM element whose visibility to set
valueBooleanA boolean value indicating whether the element should be hidden or made visible
Perform a custom animation of a set of CSS properties. The animation will be performed using CSS3 Transitions if browser supports them.
static transition(Element element, Object properties, Number duration, String easing, Function complete): void
The DOM element or jQuery object that will be animated.
propertiesObjectObject of CSS properties and values that the animation will move toward.
durationNumberString or number determining how long the animation will run
easingStringString indicating which easing function to use for the transition.
completeFunctionFunction to call once the animation is complete.
A helper method that checks whether a DOM event handler should be added through addEventListener or through attachEvent, so that IE proprietary events, such as "onpropertychange", are handled correctly in IE9.
static useAttachEvent(Element element): void
The element that exposes the event.
A helper method that checks whether a DOM event handler should be removed through removeEventListener or through detachEvent, so that IE proprietary events, such as "onpropertychange", are handled correctly in IE9.
static useDetachEvent(Element element): void
The element that exposes the event.