Question

In this jsFiddle

If you click on "A2", then "B1" you will have first opened a dropdown menu and then another dropdown within the first dropdown. Then if you click on "A2" again the second dropdown closes then the first dropdown closes.

If you open "A2", "B1" and "C2" you will have three dropdowns. If you close "B1", logically "C2" will close before "B1" will start to close, but it dosen't "B1" closes straight away. Why is this?

var codeToMassiveToPasteHere = true;
Was it helpful?

Solution

Your logic is flawed along the way. If you have B1 and C2 open and then close C2, it doesn't behave like when you close A2 when A2 and B1 are open.

I think it's because of the way you're targeting all of your elements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top