jquery only the first layer works (nested divs)
Hi, I'm a noob, but I hope there is a simple answer to this question. I have several links, which each show a particular div and hide others. Inside each of these divs I also have several sliding divs. Here is an example of my code. I have a separate file toggle.js which handles switching between the divs.
-
<div id="regularbox">
<div id="commentbox1" style="display:none">
</div>
</div>'
<div id="userbox" style="display:none">
<div id="commentbox2" style="display:none">
</div>
</div>
<div id="friendsbox" style="display:none">
<div id="commentbox3" style="display:none">
</div>
</div>
The problem is, only the commentbox in the first div slides, even though the code for sliding the other comment boxes is the same. I noticed, if I put the code for regular box at the bottom, then commentbox2 slides, but now commentbox1 and commentbox3 dont! Also if I put the code for the regular box between the user and friends boxes, the same thing happens. How do I solve this? Any help would be appreciated. Thanks.