How does jquery block the corresponding mouseout event of sub-elements? jquerymouseout

Source: Internet
Author: User

How does jquery block the corresponding mouseout event of sub-elements? jquerymouseout

How does jquery block the corresponding mouseout event of child elements:
Mouseout has a feature that triggers this event when the mouse moves into the child element. However, this feature is often not what we want in practice, the following code example describes how to achieve this effect. The code example is as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements. When the mouse pointer is moved into the sub-div, the event will not be triggered, but the event will be triggered when the mouse moves out of the parent div, next, we will scan the process to achieve this effect.
I. Implementation principle:
The principle is very simple. When the mouse pointer moves, it determines whether the node related to the event's target node is a child element. If it is a child element, it does not trigger the event, an event is triggered if it is not a child element.
Ii. Related reading:
1. For details about mouseout events, refer to the mouseout Events section of jQuery.
2. evt = window. event | e can refer to var ev = window. event | what is the role of ev.
3. For more information about toElement attributes, see section toElement event attributes in javascript.
4. For details about the relatedTarget attribute, refer to the relatedTarget event attribute section in javascript.
5. For details about this, refer to the section "this usage in javascript.
6. For details about the contains () function, refer to jQuery. contains () method 1.
7. For more information about the hide () function, see the hide () method section of jQuery.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 11377.

For more information, see: http://www.softwhy.com/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.