web-ui-pack
Version:
Web package with UI elements
11 lines (10 loc) • 801 B
TypeScript
/** Animate (show/hide) element as dropdown via moving items to position (animation per each item via inline styles)
* @param target element from that items must appear
* @param items collection that need to animate
* @param ms animation time
* @returns Promise<isFinished> that resolved by animation end;
* Rules
* * To define direction set attribute to element position="top" (or "bottom", "left", "right")
* * Before call it again on the same element don't forget to call stop(false) to cancel prev animation
* * Check if every parent up to target has overflow: visible (otherwise it doesn't work) */
export default function animateStack(target: Element, items: (HTMLElement | SVGElement)[] | HTMLCollection, ms: number, isHide?: boolean, isVertical?: boolean): WUP.PromiseCancel<boolean>;