HTML-click event overlap Processing __html

Source: Internet
Author: User

In the company to develop a set based on B/s structure of the rapid development Platform, responsible for the development of custom form modules, simply by dragging the development of Web Forms, the previous paragraph using the technology is mainly ANGULARJS, there are several ANGULARJS based plug-in library.

This sharing is how to properly handle the Click event in a parent-child nested container, as shown in the figure:





When the mouse clicks on the child Div will first trigger the child div Click event, then it triggers the parent div's Click event, and my logic is to assign this to a global variable when I click on the div, but this will not be able to select this for the child Div, and then I'll put a layer of div on their outer layers. , and then bind the point-to-click event, as shown in figure:




So the order of the Click events is

1, Sub div Click event

Add this to the array

2, the parent div Click event

Add this to the array

3, the outer div Click event

The first element of the array is the selected element







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.