Skip to content

Modules

transitions.js

Handle user defined transitions to not conflict with js-css-animations transitions

getCurrentTransition(element) ⇒ string | null

Gets user defined transitions of an element, if any

Kind: static constant of transitions

Returns: string | null - All user defined transitions combined into single shorthand property or null if there's no transition defined by the user

ParamType
elementHTMLElement

getClassTransition(className) ⇒ string

Gets the transition in a given CSS class

Kind: static constant of transitions

Returns: string - A shorthand value for CSS transition property

ParamTypeDescription
classNamestringName of the animation's CSS class

appendTransition(element, className, currTransition)

If an element already has any transition defined, other than that in className, the current transition(s) will be appended to the className transition so that no transition will be overwritten

Kind: static constant of transitions

ParamTypeDescription
elementHTMLElementThe DOM element to append the transition
classNamestringCSS class with a transition to append to other transitions
currTransitionstringTransition(s) already defined to element, before it receives the new class (className)

setDimensionsTransitions(element, wTransit, hTransit)

Appends the appropriate CSS class to handle dimension transitions. If wTransit and hTransit are both set to false, no class will be appended.

Kind: static constant of transitions

ParamTypeDescription
elementHTMLElementThe DOM element to set the transition
wTransitbooleanIndicates if should have width transition
hTransitbooleanIndicates if should have height transition

removeInlineTransition(element)

If element has an inline css transition appended by appendTransition() the inline transition property will be removed to reset the element back to its previous state

Kind: static constant of transitions

See: appendTransition

ParamTypeDescription
elementHTMLElementThe DOM element to remove the transition

removeDimensionsTransitions(element, wTransit, hTransit)

Removes the CSS class added by setDimensionsTransitions(), if any

Kind: static constant of transitions

See: module:transitions.setDimensionsTransitions

ParamTypeDescription
elementHTMLElementThe DOM element to remove the transitions
wTransitbooleanIndicates wheter there was a width transition
hTransitbooleanIndicates wheter there was a height transition

getAllTransitions(cssProperties) ⇒ string

Parses all CSS properties and combine all transitions into one valid shorthand value for 'transition' CSS property

Kind: inner method of transitions

Returns: string - All transitions combined into a single shorthand property

ParamTypeDescription
cssPropertiesCSSStyleDeclarationA collection of CSS rules

getAllTransitions~transitions : Object

Kind: inner constant of getAllTransitions

getAllTransitions~properties : Array.<string>

Kind: inner constant of getAllTransitions

getTransitionClassName(wTransit, hTransit) ⇒ string | undefined

Verifies wether there should be widht or height transition, or both, or none

Kind: inner method of transitions

Returns: string | undefined - The name of the class with the respective transition, or undefined if there should be no transitions

ParamTypeDescription
wTransitbooleanIndicates if it should have width transition
hTransitbooleanIndicates if it should have height transition