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