Makes toggling DOM elements easy and adjustable.
<a id="trigger"
data-module="toggle/Trigger"
data-options='{"targets":"toggle"}'>Trigger</a>
<p id="toggle"
data-module="toggle/Toggle"'>Toggle</p>
targets
- Comma separated string of (multiple) toggle id'stoggle
- Set this options to true if you want the trigger to act like a toggle itselfevent
- Trigger event, default is 'click'method
- Options are 'activate', 'deactivate' and (default) 'switch'preventDefault
- Cancel the event, default is truegroup
- Optional group name
attribute
- The Toggle attribute, default is data-toggle-active but it can be a Aria attribute like aria-hiddenactiveState
- Value for the Toggle active state attribute, default trueinActiveState
- Value for the Toggle inactive state attribute, default falsegroup
- Optional group name
Uses ConditionerJS for initialization but it can be used without.