Hex Core JS
    Preparing search index...

    Function getHorizontalPositionAdjustment

    • Calculates the horizontal adjustment needed to best fit an element within a set of scroll bounds. Returns the number of pixels the element should be adjusted by.

      Meant for elements that are positioned relative to a container. For example a tooltip or button confirmation box.

      Parameters

      • width: number

        The width of the element in pixels.

      • containerWidth: number

        The width of the element's container in pixels.

      • scrollBounds: ScrollBoundaryStats

        The scroll bounds around the container.

      Returns number