The dropdowns component allows for the use of .on-click and .on-hover modifier classes for dropwns. These modifiers can be used by initiating the dropdowns JavaScript using the init() method.

<div class="dropdown-trigger on-click">
  <button class="button">On Click</button>
  <div class="dropdown">

<div class="dropdown-trigger on-hover">
  <button class="button">On Hover</button>
  <div class="dropdown">

For more information on how to use and customize the dropdowns markup and styles, take a look at the dropdowns block documentation.


When initiating the dropdowns component, you can pass in the following options to override defaults.

Parameter Type Default Description
classTrigger String 'dropdown-trigger' Class name for dropdown triggers
classDropdown String 'dropdown' Class name for dropdowns
classOnClick String 'on-click' Class name for the on click behavior
classOnHover String 'on-hover' Class name for the on hover behavior
classActive String 'active' Class name for the active state
delay Milliseconds 500 The length of delay before removing the active class


Initializes the dropdowns component using either default settings or custom options passed in.

dropdowns.init( options )
Parameter Type Description
options JSON Custom options for component


Destroys the dropdowns component by removing event listeners and clearing the settings variable.


© 2018 . All rights reserved.