Summary of event object attributes and methods in jquery _ jquery

Source: Internet
Author: User
This article mainly gives a detailed summary of the event object attributes and methods in jquery. If you need them, you can refer to them and hope to help you with JQuery Reading Notes-Event attributes.
The Event attribute in JQuery events is often ignored. You don't really use it most of the time, but sometimes it still works. If you know the user's environment at the time of triggering (whether shift etc is pressed ). Each browser has a different place for event. Jquery standardizes the Event so you can use it with confidence.

*. Target: the DOM object that triggers the event. When the event is bubbling, you can determine whether it is the event source (compare event.tar get to this)
*. PageX: left attribute of the mouse, relative to page
*. PageY: top attribute of the mouse, relative to the page
* PreventDefault (): if this method is called, the original event is ignored. (For example, clicked link will not go to the new Url)
* StopPropagation (): enables Jquery to stop event bubbling.
*. Data: if the event contains EventData, you can use this attribute to obtain Eventdata.
* CtrlKey: Type: Boolean; Description: whether to press Ctrl
* ShiftKey: Type: Boolean, indicating whether the Shift key is pressed
* AltKey: Type: Boolean; Description: whether the Alt key is pressed
* CharCode: Type: Number; Description: The charCode value of the last response keyboard button
* KeyCode: Type: Number; Description: the keyCode value of the last response keyboard button
* Button: Type: Number; Description: The mouse key pressed; left-click: 1; right-click: 2; middle-click: 4
* Which: Type: Number, indicating which button is the last response. If it is a keyboard button, it is equal to charCode | keyCode. If it is a mouse button, the left button: 1, right-click: 3, key 2

Type: Event type
RelatedTarget: indicates the DOM elements that exit or enter when a mouse event is triggered.
CurrentTarget: the DOM object of the currently triggered event before the bubble, which is equivalent to this.
Result: The value returned by the previous event processing function.
ScreenX/Y: for mouse events, obtain the horizontal/vertical coordinates of the event relative to the screen origin.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.