Talking about the event handling in jquery

Source: Internet
Author: User

①jquery two ways to declare built-in event functions
event function with no Parameters-event type name () simulates the user's action
Event function with Parameters-event type name (Event function)
$ ($ ("#id"). Click (function () {})) event function with parameters
$ ($ ("#id"). Click (function () {}), $ ("#id"). Click ();) event function without parameters-not only does the #id execute the corresponding function, but also simulates the user action
②jquery built-in event type classification
⑴ Browser-related events
Error (FN) match element triggers a function when errors occur, there is no standard error event, such as an error event that triggers an image when the image src is invalid
The load (FN) match element triggers a function after loading, such as window is triggered after all DOM objects have been loaded, and the other individual elements are triggered when a single element has finished loading
Unload (FN)
Resize (FN) triggers a function when the matching element changes size
triggered when the scroll (FN) scroll bar has changed
⑵ form-related events
Change (FN) triggers when the matching element loses focus, and also when the element has focus
Select (FN) triggers when the user selects a paragraph in a text box
Triggered when submit form is submitted (FN)
⑶ Keyboard Operation related events
KeyDown (FN) trigger when the keyboard is pressed
KeyPress (FN) the trigger sequence is keydown->keyup->keypress when the keyboard is pressed and bounced
KeyUp (FN) trigger when the keyboard bounces
⑷ Mouse Operation related events
Click (FN) Order is Mousedown->mouseup->click
MouseDown (FN)
MouseUp (FN)
DblClick (FN)
MouseOver (FN)
Mouseout (FN)
MouseMove (FN) is triggered when the match element is moved, and the event handler is passed a variable-the event object (whose Clientx,clienty attribute represents the mouse coordinates)

Article Source: Web front-end video development Daquan

Public Number: Jingfeng18

Talking about the event handling in jquery

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.