# Event

## Methods

#### # (inner) delegate(eventNames, callback) → {jLight}

[DEPRECATED] Delegates event handlers to elements.
Parameters:

Name | Type | Description
--- | --- | ---
`eventNames` | string | Space separated list of event names
`callback` | function | The function to execute when the event occurs

Deprecated:
  - Will be removed in version 1.2.0, use jLight.on instead
Source:
  - index.js, line 2078
Tutorials:
  - delegate

Returns:
jLight collection

Type
  jLight

#### # (inner) off(eventNames, ?callback) → {jLight}

Removes event handlers from elements.
Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`eventNames` | string |  | Space separated list of event names
`callback` | function | <optional> | The function to remove from being executed when the event occurs

Source:
  - index.js, line 2042
Tutorials:
  - off

Returns:
jLight collection

Type
  jLight

#### # (inner) on(eventNames, callbackOrSelector, ?delegatedCallbackOrOptions, ?options) → {jLight}

Adds event handlers to elements.
Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`eventNames` | string |  | Space separated list of event names
`callbackOrSelector` | eventCallback |  | The function to execute when the event occurs or a selector to delegate events to children of the current collections elements
`delegatedCallbackOrOptions` | eventCallback | Object | <optional> | The callback to run when the event is delegated or the options to apply to the listener
`options` | Object | <optional> | The options to apply to the listener

Source:
  - index.js, line 1994
Tutorials:
  - on

Returns:
jLight collection

Type
  jLight

#### # (inner) once(eventNames, callbackOrSelector, ?delegatedCallbackOrOptions, ?options) → {jLight}

Adds event handlers to elements fo one time execution.
Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`eventNames` | string |  | Space separated list of event names
`callbackOrSelector` | eventCallback |  | The function to execute when the event occurs or a selector to delegate events to children of the current collections elements
`delegatedCallbackOrOptions` | eventCallback | Object | <optional> | The callback to run when the event is delegated or the options to apply to the listener
`options` | Object | <optional> | The options to apply to the listener

Source:
  - index.js, line 2019
Tutorials:
  - on

Returns:
jLight collection

Type
  jLight

#### # (inner) trigger(eventNames, ?jLightEventData) → {jLight}

Triggers events on the collections elements.
Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`eventNames` | string |  | Space separated list of event names
`jLightEventData` | * | <optional> | Custom data passed to the event

Source:
  - index.js, line 2161
Tutorials:
  - trigger

Returns:
jLight collection

Type
  jLight

#### # (inner) undelegate(eventNames, callback) → {jLight}

[DEPRECATED] Undelegates event handlers from elements.
Parameters:

Name | Type | Description
--- | --- | ---
`eventNames` | string | Space separated list of event names
`callback` | function | The function to remove

Deprecated:
  - Will be removed in version 1.2.0, use jLight.off instead
Source:
  - index.js, line 2128
Tutorials:
  - delegate

Returns:
jLight collection

Type
  jLight