Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ElementExt

The namespace for element related utilities.

Index

Functions

boxSizing

  • Compute the box sizing for an element.

    Parameters

    • element: Element

      The element of interest.

    Returns IBoxSizing

    The box sizing data for the specified element.

hitTest

  • hitTest(element: Element, clientX: number, clientY: number): boolean
  • Test whether a client position lies within an element.

    Parameters

    • element: Element

      The DOM element of interest.

    • clientX: number

      The client X coordinate of interest.

    • clientY: number

      The client Y coordinate of interest.

    Returns boolean

    Whether the point is within the given element.

scrollIntoViewIfNeeded

  • scrollIntoViewIfNeeded(area: Element, element: Element): void
  • Vertically scroll an element into view if needed.

    Parameters

    • area: Element

      The scroll area element.

    • element: Element

      The element of interest.

      Notes

      This follows the "nearest" behavior of the native scrollIntoView method, which is not supported by all browsers. https://drafts.csswg.org/cssom-view/#element-scrolling-members

      If the element fully covers the visible area or is fully contained within the visible area, no scrolling will take place. Otherwise, the nearest edges of the area and element are aligned.

    Returns void

sizeLimits

  • Compute the size limits for an element.

    Parameters

    • element: Element

      The element of interest.

    Returns ISizeLimits

    The size limit data for the specified element.

Generated using TypeDoc