Options
All
  • Public
  • Public/Protected
  • All
Menu

jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler (no checks for window.event required). It normalizes the target, relatedTarget, which, metaKey and pageX/Y properties and provides both stopPropagation() and preventDefault() methods.

Those properties are all documented, and accompanied by examples, on the `Event object` page.

The standard events in the Document Object Model are: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, and keyup. Since the DOM event names have predefined meanings for some elements, using them for other purposes is not recommended. jQuery's event model can trigger an event by any name on an element, and it is propagated up the DOM tree to which that element belongs, if any.

see

``

Hierarchy

Callable

  • __call<T>(event: string, properties?: T): Event & T
  • The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional.

    Check `trigger`'s documentation to see how to combine it with your own event object.

    see

    ``

    since

    1.6

    example
    //Create a new jQuery.Event object without the "new" operator.
    var e = jQuery.Event( "click" );
    ​
    // trigger an artificial click event
    jQuery( "body" ).trigger( e );
    example
    // Create a new jQuery.Event object with specified event properties.
    var e = jQuery.Event( "keydown", { keyCode: 64 } );
    ​
    // trigger an artificial keydown event with keyCode 64
    jQuery( "body" ).trigger( e );

    Type parameters

    • T: object

    Parameters

    • event: string
    • Optional properties: T

    Returns Event & T

Index

Constructors

Constructors

constructor

  • new EventStatic<T>(event: string, properties?: T): Event & T
  • The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional.

    Check `trigger`'s documentation to see how to combine it with your own event object.

    see

    ``

    since

    1.6

    example
    //Create a new jQuery.Event object without the "new" operator.
    var e = jQuery.Event( "click" );
    ​
    // trigger an artificial click event
    jQuery( "body" ).trigger( e );
    example
    // Create a new jQuery.Event object with specified event properties.
    var e = jQuery.Event( "keydown", { keyCode: 64 } );
    ​
    // trigger an artificial keydown event with keyCode 64
    jQuery( "body" ).trigger( e );

    Type parameters

    • T: object

    Parameters

    • event: string
    • Optional properties: T

    Returns Event & T

Generated using TypeDoc