jquery Basics-Events

Source: Internet
Author: User

1. Click and Dbclick Events

Click: Clicking Events

Dbclick: Double-click event

Method One: $ele. Click ()

Method Two: $ele. Click (Handler (EventObject))

Method Three: $ele. Click ([EventData], Handler (EventObject))

  

Note: It is not advisable to bind both click and Dbclick events on the same element. The order in which each browser event is triggered is different.

2. MouseDown and MouseUp events

MouseDown: mouse-pressed action

MouseUp: Mouse Release action

Method One: $ele. MouseDown ()

Method Two: $ele. MouseDown (Handler (EventObject))

Method Three: $ele. MouseDown ([EventData], Handler (EventObject))

3. MouseMove Events

MouseMove: Listens for user-moved actions.

4. MouseOver and Mouseout Events

MouseOver: Move in

Mouseout: Remove

5. MouseEnter and MouseLeave Events

Listens to whether the user moves to an internal operation.

The MouseEnter Javescript event is proprietary to Internet Explorer. Because of the usefulness of this event, jquery simulates this event so that it can be used in all browsers. The event is triggered when the mouse is moved into the element, and any HTML element can accept this event.

The difference between MouseEnter events and MouseOver:

The key point is: The bubbling way to handle the problem.

  

6. Hover Events

  

7. Focusin Events

The event that is triggered when an element acquires focus.

  

  

8. Focusout Events

The event that is triggered when an element loses focus.

9. Focus and Blur events

  

10. Change Event

The value of <input><textarea><select> can be changed and can be monitored by the change event.

  

11. Select Event

The Select event occurs when the text in the input element of the textarea or text type is selected.

Note: The Select event can only be used for <input> elements and <textarea> elements

12. Submit Event

  

13, KeyDown () and KeyUp () events

Keyboard press and let-down events

14. KeyPress () event

Binding the KeyDown event on the INPUT element will find a problem:

Each fetch is previously entered, and the current input is not available.

  

15, ON () multi-event binding

Basic usage:. On (events, [selector], [data])

  

  

16. Unload event Off ()

  

  

The role of the JQuery event object

Event delegate

 Event objects are objects that are used to record information about events that occur. Event objects are only generated when an event occurs, and can only be accessed internally by the event handler, and the event object is destroyed after all event handler functions have finished running

  

  

18. JQuery Event Object Properties and methods

Event.type: Gets the type of event

Event.pagex and Event.pagey: Gets the current coordinates of the mouse relative to the page

Event.preventdefault () Method: block default behavior

Event.stoppropagation () Method: Block Event bubbling

Event.which: Gets which key of the mouse is clicked when the mouse is clicked

Event.currenttarget: The current DOM element in the event bubbling process

  

19. Trigger Events

    

jquery Basics-Events

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.