SoFunction
Updated on 2025-04-14

prototype Element study notes (Element article 3)

1. Filter class functions

ancestors、recursivelyCollect、descendants、firstDescendant、immediateDescendants、previousSiblings、nextSiblings、siblings、match、up、down、previous、next、select、adjacent。

2. Add, delete, and modify element-like functions

insert、update、remove、replace、wrap、cleanWhitespace

3. Set various attribute functions of elements

visible、toggle、hidde、show、identify、readAttribute、writeAttribute、makeClipping、undoClipping

4. Style processing function

classNames、hasClassName、addClassName、removeClassName、toggleClassName、getStyle、setStyle、getOpacity、setOpacity。

V. Position processing function

getHeight、getWidth、scrollTo、getDimensions、makePositioned、undoPositioned、cumulativeOffset、positionedOffset、absolutize、relativize、cumulativeScrollOffset、getOffsetParent、viewportOffset、clonePosition。

6. Several functions that return boolean type

empty、descendantOf、visible

7. Event Management

fire、observe、stopObserving

8. Static function

extend

Basically there are a few categories. However, regarding positional function, there are only options but no settings, and the functions are incomplete. There is no complete explanation in the search class function usage document, the key is how to write the selector