Jquery event object properties and method summary

  • 2020-03-30 00:58:04
  • OfStack

JQuery reading notes and Event property description
The Event attribute in JQuery events is often ignored. Most of the time you don't really use it, but sometimes it works. If you know the user's environment at the time of the trigger (whether or not shift etc was pressed). Each browser has its own version of the event, and Jquery has standardized the event so it's safe to use.

*. Target  The DOM object of the event triggered by this reaction can determine whether the event is the source (compare event.target to this) when the event bubbles.
*. PageX:   Left property of the mouse, relative to page
*. PageY:   The top property of the mouse, relative to page
* the preventDefault () :   When this method is called, the original event is ignored. (for example, clicked links don't go to new urls)
* stopPropagation(): let Jquery stop the bubbling of events
*. Data:   If you have EventData in the event then you can use this property to get the EventData data.
* ctrlKey: type: Boolean
* shiftKey: type: Boolean, indicating whether or not the Shift key is pressed
* altKey: type: Boolean, indicating whether Alt key is pressed or not
* charCode: type: Number, description: last response to the keyboard key charCode value
* keyCode: type: Number
* button: type: Number, description: press the mouse key, left key :1, right key :2, middle key :4
* which: type: Number, which key is the last response? If it is the keyboard key, it is equal to charCode || keyCode; If it is a mouse button, left key :1, right key :3, middle key 2

Type: event type
RelatedTarget: for mouse events, flag the DOM element that left or entered when the event was triggered
CurrentTarget: the DOM object that triggers the current event before bubbling, equivalent to this.
Result: the value returned by the previous event handler
ScreenX /Y: for mouse events, get the horizontal/vertical coordinates of the event relative to the origin of the screen

Related articles: