I've checked out this question/answer, but it did not quite work for my situation.
How to have click event ONLY fire on parent DIV, not children?
I basically have more then just a parent and children structure. We can say there is also the grandchildren elements also. We can go on and assume it can grow much deeper.
<div class="parent">
<div class="child">
<div class="grandchild">
</div>
</div>
</div>
We have this style applied to all <div>
, which basically just says that all elements are the same size, which is also to simplify things:
div {
width: 100%
height: 100%;
}
Using jQuery, we have set a "mousedown" on all the classes.
The rule here is that no children knows what is happening with their ancestors (parent, grandparent, great-grandparent...) and cannot ask them for information of any kind (ex.: are you a <div>
? What is your class or ID? etc...) nor will they be passed any information from above.
Is there a way using jQuery to allow the "mousedown" on the oldest parent and prevent all "mousedown" from its children, grand children, etc...?
This may be something similar to stopPropagation(), but the other direction.