From 9bd15605e5a0a0dda8eab9a0f3225638bfd9de53 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 10 May 2016 22:50:04 +0200 Subject: [PATCH] Event: Suggest event.originalEvent usage jQuery.event.props has been removed, so it necessary to access event.originalEvent for non-common properties. Fixes: https://github.com/jquery/api.jquery.com/issues/405 --- categories.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/categories.xml b/categories.xml index d43d8929..c181a548 100644 --- a/categories.xml +++ b/categories.xml @@ -120,7 +120,7 @@ var e = jQuery.Event( "keydown", { keyCode: 64 } ); // trigger an artificial keydown event with keyCode 64 jQuery( "body" ).trigger( e ); -

Event Properties

+

Common Event Properties

jQuery normalizes the following properties for cross-browser consistency:

The following properties are also copied to the event object, though some of their values may be undefined depending on the event:

altKey, bubbles, button, buttons, cancelable, char, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, key, keyCode, metaKey, offsetX, offsetY, originalTarget, pageX, pageY, relatedTarget, screenX, screenY, shiftKey, target, toElement, view, which

-

OtherProperties

-

Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object.

-

Example:

+

Other Properties

+

To access event properties not listed above, use the event.originalEvent object:


-// add the dataTransfer property for use with the native `drop` event
-// to capture information about files dropped into the browser window
-jQuery.event.props.push( "dataTransfer" );
+// Access the `dataTransfer` property from the `drop` event which
+// holds the files dropped into the browser window.
+var files = event.originalEvent.dataTransfer.files;
 
]]>