Existing .fs-dropdown div — type: 'dropdown' passed so type init runs automatically
Animals
Plants
Fungi
Minerals
—
Existing .fs-number-picker div — type: 'number-picker' auto-initialises
—
Arbitrary custom markup
Custom attached element
Any markup goes here - attach() wraps it with Floater positioning and scroll-close behaviour.
10. Advanced options
closeOthers: false - all can be open
gap: 0 / 12 / 28
minWidth: 320
onChange: false (silent)
events suppressed
bind() multi-anchor - same floater, multiple triggers
—
trigger: 'contextmenu' - right-click zone
Right-click here
—
trigger: 'focus' - input focus opens floater
—
11. Custom types - registerType()
Color palette picker
#5588ff
Star rating
—
Icon / emoji picker
—
Confirm dialog (yes/no)
—
context-menu built-in - global: true
Right-click anywhere (except inputs/selects) to open, including over other floaters. global:true wires contextmenu automatically. Does not close when other floaters open, does not close others when it opens. Last selection shown bottom-right.
—
Progress / status indicator
—
12. Dynamic operations
destroy() + recreate
exists: yes
closeAll() / closeAll(filter)
open some first:
update() - live marker change
—
has() / get() API - reads mark-upd state
—
12b. Programmatic / remote triggers - no direct interaction needed
Open after 1.5s delay (timer)
—
floater anchors here
Remote: click button A → opens anchored to button B
→
—
Chain: picking A fires B on a different anchor
Step 2 opens here
—
Open from input focus (text-suggestions on a label click)
—
Programmatic open/close via API buttons - persist only
floater anchor
Console: _trigProg.open()
13. Viewport edge positions - floater flips above/below as needed
Six fixed buttons are pinned to the viewport edges.
14. preferRight / preferLeft / centerY
preferRight - opens right, flips left if needed
—
preferLeft - opens left, flips right if needed
—
preferRight + centerY - vertically centred on anchor
—
15. persist type / persistOnOutsideClick - stays open until explicitly closed
persistOnOutsideClick: true - click outside does nothing
—
Floater within floater - child keeps parent open
—
Floater within floater - child selection closes both
—
16. Modal - backdrop blocks page, must be explicitly dismissed
video - rememberProgress (close + reopen continues)
18. setDefaults() - global and type-level defaults
global gap: 10 applied to all instances created after setDefaults()
type default — setDefaults('dropdown', { minWidth: 200 })
instance opt overrides type default — minWidth: 80
19. Image floater
Basic image + caption
update() - swap src + caption
closeButton: true
20. toFrontOn - z-index stacking
All three open on the same anchor with closeOthers: false so they overlap. Each has a different size. Click/hover inside each to test bring-to-front behaviour.
3 close anchors, 1 callsite - floaters overlap for z-stack test
click
hover
none
21. Scroll behaviour
Default (closeOnScroll: false): stays open and repositions to follow the anchor as the page scrolls. Use closeOnScroll: true to close on scroll. persistOnOutsideClick: true → scroll-immune but static (fixed position, does not follow anchor).
closeOnScroll: true - closes on scroll
—
closeOnScroll: false (default) - follows anchor
—
persistOnOutsideClick: true - also scroll-immune
—
modal: true - scroll-immune + backdrop (click backdrop to close)
—
22. Press trigger & scroll select
trigger: 'press' opens on mousedown and selects by drag. scrollSelect: true lets you scroll through options without opening the floater.
trigger: 'press' - hold and drag to select
—
scrollSelect: true - scroll wheel on button (no open)
animateIn / animateOut presets, a custom registerAnimation(), and switching a floater's animation on demand via update().
animateIn/Out: 'fade'
animateIn/Out: 'scale'
animateIn: 'slide-down', animateOut: 'slide-up'
Floater.registerAnimation('flip', {...}) - custom animation, own CSS classes registered by the page
instance.update({ animateIn, animateOut, animateInDuration, animateOutDuration }) - switch a floater's in/out animation and per-direction durations on demand, no recreate
-
24. Event hooks
Floater.on() observing every instance globally, custom events via emit(), and querying open floaters.
Floater.on() - global counts across every basic event, every floater on this page (since page load)
-
instance.emit('ping') - instance.on() only sees the instance it's attached to; Floater.on() sees every instance
-
Floater.getOpen(filter) - query open floaters by type / id prefix