Floaty
Documentation generated by typedoc
on Wed Feb 19 2025 15:14:11 GMT+0000 (Coordinated Universal Time)
with typedoc-plugin-markdown
(and then rendered by quarto
).
Interfaces
TFloaty
Defined in: floaty.js:33
Properties
cards
: Element[]; cards
Defined in: floaty.js:36
All of the cards in the floaty.
container
: Element; container
Defined in: floaty.js:35
The container with all of the cards.
elem
: HTMLElement; elem
Defined in: floaty.js:34
The outermost floaty div.
initialize()
: () => void; initialize
Defined in: floaty.js:42
Returns
void
overlayControls
: null | TOverlay; overlayControls
Defined in: floaty.js:37
Output of Overlay
(from overlay.js
).
resizeForColumns()
: (countColumns) => void; resizeForColumns
Defined in: floaty.js:38
Resize to a specified number of columns.
Parameters
countColumns
number
Returns
void
resizeForWidth()
: (width?) => void; resizeForWidth
Defined in: floaty.js:39
Resize the columns for the current window width or specified width.
Parameters
width?
number
Returns
void
toggleTooltip()
: (width?) => void; toggleTooltip
Defined in: floaty.js:40
Toggle tooltips into card descriptions and vice versa around some breakpoint.
Parameters
width?
number
Returns
void
TFloatyOptions
Defined in: floaty.js:25
Properties
overlayControls?
: null | TOverlay; optional overlayControls
Defined in: floaty.js:26
Output of Overlay
(from overlay.js
).
resize?
: object; optional resize
Defined in: floaty.js:27
Enable resizing.
resizeBreakpoints?
: TBreakpointColumns; optional resizeBreakpoints
Defined in: floaty.js:28
Breakpoint names mapping to the number of columns for the range. By default BREAKPOINTS_RESIZE
.
tooltipsToggle?
: boolean; optional tooltipsToggle
Defined in: floaty.js:29
Toggle tooltips.
tooltipsToggleBreakpoint?
: EnumBSBreakpoint; optional tooltipsToggleBreakpoint
Defined in: floaty.js:30
Breakpoint for toggleing tooltips into card descriptions. By default, BREAKPOINT_TOOLTIPS_TRANSFORM
.
Type Aliases
EnumBSBreakpoint
type EnumBSBreakpoint<> = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
Defined in: util.js:10
Type Parameters
TBreakpointColumns
type TBreakpointColumns<> = Map<EnumBSBreakpoint, number>;
Defined in: floaty.js:10
Type Parameters
Variables
FloatyInstances
const FloatyInstances: Map<string, TFloaty>;
Defined in: floaty.js:6
Functions
Floaty()
function Floaty(elem, options): TFloaty;
Defined in: floaty.js:62
Add responsiveness to a floaty
element.
Ideally, these are styled with floaty
as in floaty.scss
.
Responsiveness includes:
- opening overlays and links when clicking on
floaty-items
, - moving tooltips to descriptions and vice versa at certain breakpoints,
- resizing the grid while keeping cards of equal width using fillers,
Parameters
elem
HTMLElement
The target to add responsiveness to.
options
Configuration options.
Returns
Throws
if element
is not passed, or when the floaty does not contain a floaty-container
element.
lazyFloaty()
function lazyFloaty(elemId, options): TFloaty;
Defined in: floaty.js:376
Wrapper for Floaty
to minimize amount of js the floaty
filter includes.
Parameters
elemId
string
The target element to add Floaty
functionality to.
options
Configuration options.
overlayControls
null
| TOverlay
Pass already existing overlayControls
to Floaty
(instead of creating them from overlayId
).
overlayId
string
Identifier for the associated overlay.
Returns
Throws
when an element with identifier elemId
or options.overlayId
cannot be found.
References
TOverlay
Re-exports TOverlay