API Docs for: 1.0.2
Show:

AW2.Event Class

Module: aw2

aw2 library event (jquery implementation)

Item Index

Methods

Methods

bind

(
  • event
  • selector
  • callback
  • bind
)
Undefined

Bind events to an element

Parameters:

  • event String

    event type

  • selector String

    the selector you wish your event to be bound to

  • callback Function

    the function to happen once the event has been triggered

  • bind String | | Boolean

    the selector of the element to bind to instead of binding event to the document

Returns:

Undefined:

Example:

Simple click event, defaults to the document

    $aw2.bind("click", "h3", function() {
        console.log('Document Live');
    });

Click event that is static

    $aw2.bind("click", "h3", function() {
        console.log('Document Live');
    }, false);

Attached click event to all <p> inside of the .live element

    $aw2.bind("click", "p", function() {
        console.log('Document Live');
    }, '.live');

unbind

(
  • event
  • selector
  • bind
)
Undefined

unbind events from an element

Parameters:

  • event String

    event type

  • selector String

    the selector you wish your event to be bound to

  • bind String | | Boolean

    the selector of the element to bind to instead of binding event to the document

Returns:

Undefined:

Example:

Simple click event, defaults to the document

    $aw2.unbind("click", "h3");

Click event that is static

    $aw2.unbind("click", "h3", false);

Attached click event to all

inside of the .live element

    $aw2.unbind("click", "p", '.live');