UFFloater is a class to show a floating element shown on top of the DOM.

The class can be used to show a floater somewhere in the browser or relative to a certain element.

The class uses the css class 'uf-floater', make sure no css class style exists with that name.

Constructors

Accessors

  • get contentHeight(): number

    Height of content in pixels. This value is not immediately available, but becomes known after a few milliseconds. The value is 0 if the content is a string.

    Returns number

  • get contentWidth(): number

    Width of content in pixels. This value is not immediately available, but becomes known after a few milliseconds. The value is 0 if the content is a string.

    Returns number

  • get height(): number

    Height of floater in pixels. This value is not immediately available, but becomes known after a few milliseconds.

    Returns number

  • get visible(): boolean

    Returns if the floater is visible.

    Returns boolean

    True if the floater is part of the DOM and visible.

  • get width(): number

    Width of the floater in pixels. This value is not immediately available, but becomes known after a few milliseconds.

    Returns number

Methods

  • Handles mouse up / touch end on the document.

    Parameters

    • anEvent: Event

    Returns void

  • Closes the floater if it can be closed.

    Parameters

    • anEvent: null | Event = null

      Event that resulted in call to hide or null if the action was triggered via a direct call

    Returns boolean

    True if floater is hidden or busy hiding, false if floater could not be closed.

  • Sets new element(s) to position the floater to and then show the floater. It is a combination of setOptions and show

    Parameters

    • anElement: string | HTMLElement | HTMLElement[]

      Element(s) to position to

    Returns void

  • Refreshes the contents and then refreshes the position if the float is visible.

    Returns void