AW2.Event Class
aw2 library event (jquery implementation)
Methods
bind
(
Undefined
-
event
-
selector
-
callback
-
bind
Bind events to an element
Parameters:
-
event
Stringevent type
-
selector
Stringthe selector you wish your event to be bound to
-
callback
Functionthe function to happen once the event has been triggered
-
bind
String | | Booleanthe 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
(
Undefined
-
event
-
selector
-
bind
unbind events from an element
Parameters:
-
event
Stringevent type
-
selector
Stringthe selector you wish your event to be bound to
-
bind
String | | Booleanthe 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');