off

Removes the callbacks associated with the given node. If no callback is provided, all callback associated with the event are removed.

Source:
Example
function clickCallback() {
  console.log('CLICKED');
}

$$$
.find('Cube_1')
.on('click', clickCallback)
.trigger('click') // logs 'CLICKED'
.off('click', clickCallback)
.trigger('click'); // no log

$$$
.find('Cube_1')
.on('click', clickCallback)
.trigger('click') // logs 'CLICKED'
.off('click') // all callbacks associated with `click` are removed
Parameters:
Name Type Attributes Description
event object

The event to perform operation.

callback function <optional>

The specific callback to remove from the event.

Returns:
  • Chainable api by returning the node.
Type
self