Dropdown Element
Interact with Webflow's Dropdown Element
Goals
Make the dropdown element programmatically accessible to scripts, for open, close, toggle, query, item manipulation, and more
Add certain attribute-based common functionality as behavior modifications
Auto open on page load
Future;
Possibly replace the dropdown to allow for custom behaviors, like "sticky" behavior
Where the dropdown can only be opened/closed on script
Or specific behaviors like clicking the toggle
Item manipulation
Script-add / edit / delete items
Re-sort options
Keep WF dropdown working as normal
Data acquisition;
Designated data source
Filter state
Sort state
Possible;
Support selected item?
Support multiple selected items?
Support text entry, combobox
Support quick selection filtering of available items e.g. countries
Features
Current features are simple;
Attributes
Auto open on page load
https://discourse.webflow.com/t/how-to-get-dropdown-open-on-page-load-automatically/158399/16
wfu-dropdown-init = open | closed
API
For developers, there is now an ability to manipulate a Webflow native dropdown through custom code, including;
open
close
toggle
query state
Demonstration
Usage Notes
wfu-dropdown
REQUIRED. Identifies this dropdown element as one that should be managed by SA5.
Place this attribute on the dropdown element directly ( not the toggle element ).
wfu-dropdown-init = (action)
OPTIONAL. On page load, initialize the dropdown state to-
open
closed
( default )
Place this attribute on the dropdown element directly ( not the toggle element )
API
BETA. See the cloneable.
Notes
https://discourse.webflow.com/t/how-to-get-dropdown-open-on-page-load-automatically/158399/16
Getting Started ( NOCODE )
STEP 1 - Add the Library
First, add the library as detailed in Quick Start.
STEP 2 - Apply the custom attributes to the elements you want to affect
See above for details.
Last updated
Was this helpful?