My class library documentation

Source: Internet
Author: User

H object set processing functions Item ()

Description: used to select one or more specified items from the H object set.

Syntax:H object.Item ([Num[,Num2])

Parameter description: If no parameter is specified, the number of elements selected in the H object is returned.

Num:Number, if it is a positive Number, select the corresponding item in the H object, 1 is the first item; if this parameter is negative, in the H object, select other items that do not contain the positive number of the parameter. [Optional]

Num2:Number, select the item of the num-num2 in the H object. Currently, negative numbers are not supported. [Optional]

Get the next sibling Node Next ()

Note: Retrieving text nodes next to the next brother node will ignore text nodes of Firefox and other browsers. If the node does not exist, null will be returned.

Syntax:H object.Next ()

Get the last sibling Node Pre ()

Note: retrieving the last sibling node in the adjacent region ignores text nodes of Firefox and other browsers. If the node does not exist, an empty value is returned.

Syntax:H object.Pre ()

Css style setting/getting Functions Css ()

Description: Used to set or obtain the css style of an element. This function does not support processing transparency styles.

Syntax:H object.Css (CssText[,Cover])

Parameter description:CssText:String. If there is no colon in the style String, it indicates obtaining the css style. If there is a colon, it indicates setting the css style. For example, "font-size: 12px; background: red" is used to set css, "fontSize", "backgroundImage" is used to get css styles, "fontSize, backgroundImage "If there are multiple attributes like this, an array is returned. You can use the attribute as the key name to reference the corresponding items in the array. Of course, you can also use numbers to reference the items.

Cover:Boolean, which selects the item of the num-num2 in the H object. Currently, negative numbers are not supported. [Optional]

Set Transparency/obtain FunctionsOpacity()

Description: Used to set or obtain the transparency of elements.

Syntax:H object.Opacity ([Opacity])

Parameter description: If no parameter exists, the transparency is obtained.

Opacity:Number, transparency value, range: 0 ~ 1

Set/retrieve functions in HTMLHtml()

Description: innerHTML used to set or obtain elements

Syntax:H object.Html ([Html])

Parameter description: If no parameter exists, it is used to obtain the HTML

Html:String, html String

Text setting/getting FunctionsText()

Description: Used to set or obtain the innerText/textContent of an element.

Syntax:H object.Text ([Text])

Parameter description: If the parameter does not exist, it is used to obtain text.

Text:String, text String

 

Event registration function On ()

Note: this is used to register events for the element. this in the listening function points to the element of the event registration, and an encapsulated event object is automatically imported to the first parameter of the listening function.

Syntax:H object. on (type, listener)

Parameter description:Type:String, the event type to be registered, without the on prefix. [Required]

Listener:Function, the listener Function to be registered. [Required]

Event object:

Note: The event object will be automatically passed in as the first parameter of the listener function. The event object is not a native time object, but a packaged time object, handling many compatibility issues, currently, the following attributes and methods are supported:

AltKey, ctrlKey, shiftKey, button, clientX, clientY, screenX, screenY, pageX, pageY, layerX, layerY, type, target, currentTarget, which, stopPropagation, preventDefault

The meaning and usage are the same as those of w3c standards.

Event logout Function Off ()

Events used to deregister Elements

Syntax:H object.Off ([Type[,Listener])

Parameter description:Type:String, the event type to be deregistered, without the on prefix. If this parameter is omitted, all types of events of the element are deregistered. [Optional]

Listener:Function, the listener Function to be deregistered. If this parameter is omitted, all listening functions of this type of event will be deregistered. [Optional]

Page event destruction Function H. off ()

Note: You can call this function to cancel all listening functions of all event types of all elements on the page. Simply put, all events of all elements on the page are removed.

Syntax:H. off ()No Parameter

Animation Functions Animate ()

Note: All functions registered on the same element constitute an animation queue. animation execution with no delay always takes precedence over delayed animation execution, A delayed animation is executed only after it is executed. If there are multiple delayed animations, the animation is executed based on the writing order and delayTime values.

Syntax:H object. animate (delay, delayTime, property, begin, change, time[, Type[, OutOrin[, Callback])

Parameter description:Dealy:Boolean: Specifies whether to delay animation execution. This parameter is equivalent to an animation queue. true indicates yes, and false indicates no. The delay indicates that the animation is executed after the previous animation is executed, on the same element, all animation without delay (that is, if this value is false) are executed simultaneously, and the delayed animation is executed after the animation is executed, if there are multiple delayed animations, the delayed animation in the order of writing is executed after the execution of the previous delayed animation is completed. Note: The latency effect only takes effect on the same element. [Required]

DelayTime:Number. value range: 0 ~ 1. specify a time point. When the animation arrives at this time point, the next animation in the queue will be executed. 0 indicates that the next animation will also be executed when the animation starts to be executed, 1 indicates that the next animation will be executed after the animation is executed. 0.5 indicates that the next animation will be executed when half of the animation is executed. If the animation is not delayed, the value is always 1. Note: This value affects the execution of the next animation in the queue and does not affect this animation. [Required]

Property: String: Specifies the animation attribute. Currently, the available attributes include width, height, top, left, right, bottom, opacity, and opacity. The value range is 0 ~ 1. [Required]

Begin: Number, the initial value of the property to be animated. [Required]

Change: Number, the amount to be changed, that is, a relative value. [Required]

Time: Number, which determines the animation time, in milliseconds. Generally, the value 100 is equivalent to about 1 second. [Required]

Type: String, easing type; optional value: "t0 "~ "T7", '"t0" indicates a uniform speed. The default value is "". [Optional]

OutOrin: String, slow in or slow out. The optional values are "o", "I", and "oi", which respectively indicate slow in, slow out, slow in and slow out. The default value is slow out. [Optional]

Callback: Function: the callback Function after the animation is executed [Optional]

 

Drag Function Drag ()

Note: after this method is called, the object has the mouse drag function.

Syntax:H object. drag (handle[, Parent[, Lock])

Parameter description:Handle: H object. This parameter specifies a drag-and-drop handle. It must be in the object to be dragged. If no handle is used, it is set to null. [Required]

Parent: H object, which specifies the parent element to be referenced (or ancestor element) by dragging the element. This element must be set to dynamic positioning. This parameter is generally used only when the drag element is limited to a certain range. [Optional]

Lock: Boolean. You must set the second parameter to use this parameter. "true" indicates that the drag range is restricted. "false" indicates that the drag range is not restricted. The default value is "true. [Optional]

Undrag Function Undrag ()

Note: after this method is called, the object cannot be dragged (provided that the drag () method is called before ).

Syntax:H object. undrag ()No Parameter

Hover ()

Description: This function is used to simulate mouse hover.

Syntax:H object.Hover (FunOver[, FunOut])

Parameter description:FunOver:Function: the Function to be executed when the cursor is over the element [required]

FunOut:Function, the Function to be executed when the mouse removes an element. If this parameter is omitted, the mouse removes the element without any action. [Optional]

Hide Functions Hide ()

Note: after this method is called, the display attribute of the object becomes none.

Syntax:H object. hide ()No Parameter

Display function Show ()

Note: after this method is called, the display attribute of the object changes to block.

Syntax:H object. show ()No Parameter

Bytes -----------------------------------------------------------------------------------------------------

Element feature Functions OffsetLeft ()

Description: gets the offserLeft value of an element.

Syntax:H object. offsetLeft ()No Parameter

Element feature Functions OffsetTop ()

Description: gets the offserTop value of an element.

Syntax:H object. offsetTop ()No Parameter

Element feature Functions OffsetWidth ()

Description: gets the offserWidth value of an element.

Syntax:H object. offsetWidth ()No Parameter

Element feature Functions OffsetHeight ()

Description: gets the offserHeigth value of an element.

Syntax:H object. offsetHeigth ()No Parameter

Obtain/set element feature Functions ScrollLeft ()

Note: If a parameter is set, the scrollLeft value of the element is obtained. If no parameter is set, the value is obtained.

Syntax:H object. scrollLeft ([value])

Obtain/set element feature Functions ScrollTop ()

Note: If a parameter is set, the scrollTop value of the element is obtained. If no parameter is set, the result is obtained.

Syntax:H object. scrollTop ([value])

Bytes --------------------------------------------------------------------------------------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.