Event

The event utility provides functions to add and remove event listeners.

defined in: base.js

Namespace

Methods

  • Event. add (targets, type, fn, scope) <static> Adds an event listener.similar to addEventListener in DOM3 Events
  • Event. delegate (targets, eventType, selector, fn, scope) <static>
  • Event. fire (targets, eventType, eventData, onlyHandlers) <static> fire event,simulate bubble in browser.
  • Event. fireHandler (targets, eventType, eventData) <static> does not cause default behavior to occur does not bubble up the DOM hierarchy
  • Event. remove (targets, type, fn, scope) <static> Detach an event or set of events from an element.
  • Event. undelegate (targets, eventType, selector, fn, scope) <static>

Namespace Detail

  • Event
    The event utility provides functions to add and remove event listeners.

Methods Detail

  • Event. add (targets, type, fn, scope) <static> view source
    Adds an event listener.similar to addEventListener in DOM3 Events
    Defined in:add.js.
    Parameters
    •   targets KISSY selector
    •   type {String} The type of event to append.use space to separate multiple event types.
    •   fn {Function} The event handler/listener.
    • [ scope ] {Object} The scope (this reference) in which the handler function is executed.
  • Event. delegate (targets, eventType, selector, fn, scope) <static> view source

    Defined in:event.js.
    Parameters
    •   targets KISSY selector
    • [ eventType ] {String} The type of event to delegate. use space to separate multiple event types.
    •   selector {String|Function} filter selector string or function to find right element
    • [ fn ] {Function} The event handler/listener.
    • [ scope ] {Object} The scope (this reference) in which the handler function is executed.
  • Event. fire (targets, eventType, eventData, onlyHandlers) <static> view source
    fire event,simulate bubble in browser. similar to dispatchEvent in DOM3 Events
    Parameters
    •   targets html nodes
    •   eventType {String|Event.Object} event type
    • [ eventData ] additional event data
    • [ onlyHandlers ] {Boolean} only fire handlers
    Returns
    • {Boolean} The return value of fire/dispatchEvent indicates whether any of the listeners which handled the event called preventDefault. If preventDefault was called the value is false, else the value is true.
  • Event. fireHandler (targets, eventType, eventData) <static> view source
    does not cause default behavior to occur does not bubble up the DOM hierarchy
    Parameters
    •   targets
    •   eventType {Event.Object | String}
    • [ eventData ]
  • Event. remove (targets, type, fn, scope) <static> view source
    Detach an event or set of events from an element. similar to removeEventListener in DOM3 Events
    Defined in:remove.js.
    Parameters
    •   targets KISSY selector
    • [ type ] {String} The type of event to remove. use space to separate multiple event types.
    • [ fn ] {Function} The event handler/listener.
    • [ scope ] {Object} The scope (this reference) in which the handler function is executed.
  • Event. undelegate (targets, eventType, selector, fn, scope) <static> view source

    Defined in:event.js.
    Parameters
    •   targets KISSY selector
    • [ eventType ] {String} The type of event to undelegate. use space to separate multiple event types.
    •   selector {String|Function} filter selector string or function to find right element
    • [ fn ] {Function} The event handler/listener.
    • [ scope ] {Object} The scope (this reference) in which the handler function is executed.
blog comments powered by Disqus
Top