Skip to content

Modules

resize-parent.js

Handles parent element's resizing to perform width/height smooth transitions when child element is being animated

initParentResize(args) ⇒ Object

Handles parent element width/height transitions during child element's animation

Kind: inner method of resize-parent

Returns: An object with the dimension(s) to transition and the parent element's measurements before and after the child element's animation is performed

ParamTypeDescription
argsObjectContaining all the information needed to initiate parent's dimensions transitions

endParentResize(element, opts)

Removes all CSS properties and classes added to the parent element to handle the dimensions transitions during the animation

Kind: inner method of resize-parent

ParamTypeDescription
elementHTMLElementThe DOM element being animated
optsObjectIndicates which dimensions were transitioned

getRootCssProperty(property) ⇒ string

Gets the default value of a CSS property defined in js-css-animations.css

Kind: inner method of resize-parent

Returns: The default js-css-animation property value

ParamTypeDescription
propertystringPROPERTY_NAMES key corresponding to a CSS property name

setParentCssProperties(element)

Sets the same CSS variables (customized by the options in the animation function) in the parent element, so the parent's dimensions transitions will have the same custom properties of the child element's animations

Kind: inner method of resize-parent

ParamTypeDescription
elementHTMLElementThe DOM element being animated

getDimension(wTransit, hTransit) ⇒ string | undefined

Returns a string with the dimension to transition, or 'all' for both dimensions, or undefined if neither width nor height should be transitioned

Kind: inner method of resize-parent

Returns: undefined if both parameters are false, 'all' if both are true and 'width' or 'height' if only wTransit or hTransit is true, respectively

ParamTypeDescription
wTransitbooleanIndicates if parent element should have width transition
hTransitbooleanIndicates if parent element should have height transition

setOverflowHidden(el)

Adds a CSS class which will set the overflow property to 'clip' (or 'hidden')

Kind: inner method of resize-parent

ParamTypeDescription
elHTMLElementThe DOM element which will receive the CSS class

removeOverflowHidden(el)

Removes the CSS class which sets the overflow property to 'clip' (or 'hidden')

Kind: inner method of resize-parent

ParamTypeDescription
elHTMLElementThe DOM element with the CSS class to remove