Toggles visibility between two elements on the page.
- Source:
Example
<button class="toggle-switch">
<span class="toggle-off">Initial State</span>
<span class="toggle-on">Toggled State</span>
</button>
Methods
(inner) handleOutsideClick($toggle, evt)
- Source:
Handle clicks outside of a $toggle element
Parameters:
Name | Type | Description |
---|---|---|
$toggle |
toggle element clicked |
|
evt |
document click event |
(inner) init()
- Source:
Binds click events to any toggle-switch
blocks on the page.