jQuery: The Write Less, Do More JavaScript Library

API/1.2/Events

From jQuery JavaScript Library

(Redirected from Events)
Jump to: navigation, search

This section details the event-related functions in the jQuery API. For more information about how jQuery handles and normalizes event properties and functions in a cross-browser manner, see Events (Guide).

NameType
Page Load:


NameType
ready( fn ) Returns: jQuery
Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
Event Handling:






NameType
bind( type, data, fn ) Returns: jQuery
Binds a handler to one or more events (like click) for each matched element. Can also bind custom events.
one( type, data, fn ) Returns: jQuery
Binds a handler to one or more events to be executed once for each matched element.
trigger( type, data ) Returns: jQuery
Trigger a type of event on every matched element.
triggerHandler( type, data ) Returns: jQuery
This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.
unbind( typedata ) Returns: jQuery
This does the opposite of bind, it removes bound events from each of the matched elements.
Interaction Helpers:



NameType
hover( over, out ) Returns: jQuery
Simulates hovering (moving the mouse on, and off, an object). This is a custom method which provides an 'in' to a frequent task.
toggle( fn, fn2, fn3,fn4,... ) Returns: jQuery
Toggle among two or more function calls every other click.
Event Helpers:























NameType
blur( ) Returns: jQuery
Triggers the blur event of each matched element.
blur( fn ) Returns: jQuery
Bind a function to the blur event of each matched element.
change( ) Returns: jQuery
Triggers the change event of each matched element.
change( fn ) Returns: jQuery
Binds a function to the change event of each matched element.
click( ) Returns: jQuery
Triggers the click event of each matched element.
click( fn ) Returns: jQuery
Binds a function to the click event of each matched element.
dblclick( ) Returns: jQuery
Triggers the dblclick event of each matched element.
dblclick( fn ) Returns: jQuery
Binds a function to the dblclick event of each matched element.
error( ) Returns: jQuery
Triggers the error event of each matched element.
error( fn ) Returns: jQuery
Binds a function to the error event of each matched element.
focus( ) Returns: jQuery
Triggers the focus event of each matched element.
focus( fn ) Returns: jQuery
Binds a function to the focus event of each matched element.
keydown( ) Returns: jQuery
Triggers the keydown event of each matched element.
keydown( fn ) Returns: jQuery
Bind a function to the keydown event of each matched element.
keypress( ) Returns: jQuery
Triggers the keypress event of each matched element.
keypress( fn ) Returns: jQuery
Binds a function to the keypress event of each matched element.
keyup( ) Returns: jQuery
Triggers the keyup event of each matched element.
keyup( fn ) Returns: jQuery
Bind a function to the keyup event of each matched element.
load( fn ) Returns: jQuery
Binds a function to the load event of each matched element.
mousedown( fn ) Returns: jQuery
Binds a function to the mousedown event of each matched element.
mousemove( fn ) Returns: jQuery
Bind a function to the mousemove event of each matched element.
mouseout( fn ) Returns: jQuery
Bind a function to the mouseout event of each matched element.
mouseover( fn ) Returns: jQuery
Bind a function to the mouseover event of each matched element.
mouseup( fn ) Returns: jQuery
Bind a function to the mouseup event of each matched element.
resize( fn ) Returns: jQuery
Bind a function to the resize event of each matched element.
scroll( fn ) Returns: jQuery
Bind a function to the scroll event of each matched element.
select( ) Returns: jQuery
Trigger the select event of each matched element.
select( fn ) Returns: jQuery
Bind a function to the select event of each matched element.
submit( ) Returns: jQuery
Trigger the submit event of each matched element.
submit( fn ) Returns: jQuery
Bind a function to the submit event of each matched element.
unload( fn ) Returns: jQuery
Binds a function to the unload event of each matched element.