Mouse events for jquery events

Source: Internet
Author: User

Mouse events are triggered when the user moves the mouse cursor or clicks with any mouse button.
(1): Click event: The Click event is triggered when the user taps the left mouse button on the element and releases the left button on the same element.
$ (' P '). Click (function () {
Alert (' Click function is running! ');
});
(2):d bclick event: The Dbclick event is triggered after the user has completed a quick and continuous two clicks, and the speed of the double-click depends on the operating system settings. The general double-click event is not used frequently in the page.
$ (' P '). Dbclick (function () {
Alert (' Dbclick function is running! ');
});
(3): MouseDown event: The MouseDown event is triggered when the user taps the mouse button, not the same as the KeyDown event, which is triggered only when the mouse is pressed.
$ (' P '). MouseDown (function () {
Alert (' MouseDown function is running! ');
});
(4): MouseUp event: The MouseUp event is triggered when the user releases the mouse, and if released on the same element as the mouse-down element, the Click event is also triggered.
$ (' P '). MouseUp (function () {
Alert (' MouseUp function is running! ');
}). Click (function () {
Alert (' Click function is running too! ');
});
(5): MouseOver event: The MouseOver event is triggered when the user moves the mouse from one element to another, if you need to know the Relatedtagrget property from which the element can be used.
(6): Mouseout event: The Mouseout event is triggered when the user moves the mouse out of an element, including moving from the parent element to the child element, or using the keyboard to jump to the element.
(5) and (6) These events are generally not commonly used, and it is difficult to interact with the user, which means that user events are not easily captured.
(7): MouseEnter event: The MouseEnter event is triggered when the user cursor enters the element.
$ (' P '). MouseEnter (function () {
Alert (' MouseEnter function is running! ');
});
(8): Mouseleaver event: The Mouseleaver event is triggered when the user's cursor leaves the element.
$ (' P '). Mouseleaver (function () {
Alert (' Mouseleaver function is running! ');
});
(7) and (8) These two events are generally used, and in jquery you can use the hover function instead of these two functions.
$ (' P '). Hover (function () {
Alert (' MouseEnter function is running! ');
},function () {
Alert (' Mouseleaver function is running! ');
});

Mouse events for jquery 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.