This is a rather simple problem, but I can't seem to get it to work.
- <div>
- <div class=a></div>
- <div class=b></div>
- <div class=c></div>
- <div class=d></div>
- </div>
- <div>
- <div class=a></div>
- <div class=b></div>
- <div class=c></div>
- <div class=d></div>
- </div>
This repeats 22 times (for different areas that can be clicked)
When each div C is clicked (as all the other divs are layered) I have an ajax output that outputs a value from a php script that is either TRUE or FALSE. This all works fine.
If the value is TRUE, I want div D to be displayed (it's currently hidden). However, I want div D to be displayed on the current div and all successive divs.
i.e.
<main div1>
<main div2>
<main div3>
<main div4>
<main div5>
<main div6>
If div C within main div3 is clicked, I want the div with class of D within div 3, div4, div5, and div6 to become active.
I will write what I've tried:
- currentDiv.parent().nextAll('.classD').show(); // note: currentDiv is a variable for $(this). For some reason, $(this) didn't work within the function within the ajax, so assume currentDiv = div C within the main div
I know the method of nextAll only selects siblings, but I hope it helps you see what I am trying to do..
Thanks in advance :D