Appearance
Modules
transitions.js
Handle user defined transitions to not conflict with js-css-animations transitions
- export
- inner
- getAllTransitions(cssProperties) ⇒
string
- transitions :
Object
- properties :
Array.<string>
- transitions :
- getTransitionClassName(wTransit, hTransit) ⇒
string
|undefined
- getAllTransitions(cssProperties) ⇒
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
Param | Type |
---|---|
element | HTMLElement |
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
Param | Type | Description |
---|---|---|
className | string | Name 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
Param | Type | Description |
---|---|---|
element | HTMLElement | The DOM element to append the transition |
className | string | CSS class with a transition to append to other transitions |
currTransition | string | Transition(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
Param | Type | Description |
---|---|---|
element | HTMLElement | The DOM element to set the transition |
wTransit | boolean | Indicates if should have width transition |
hTransit | boolean | Indicates 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
Param | Type | Description |
---|---|---|
element | HTMLElement | The 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
Param | Type | Description |
---|---|---|
element | HTMLElement | The DOM element to remove the transitions |
wTransit | boolean | Indicates wheter there was a width transition |
hTransit | boolean | Indicates 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
Param | Type | Description |
---|---|---|
cssProperties | CSSStyleDeclaration | A collection of CSS rules |
- getAllTransitions(cssProperties) ⇒
string
- transitions :
Object
- properties :
Array.<string>
- transitions :
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
Param | Type | Description |
---|---|---|
wTransit | boolean | Indicates if it should have width transition |
hTransit | boolean | Indicates if it should have height transition |