selective cascading access on matching elements
Hello @all,
I´m very new to jQuery and have a problem I can´t solve by myself. I have an ul li list with items that match a later following div - the match is the id. That id is matching another following div by id. All elements are dynamically generated and can vary in depth. I have a working set with onclick fuctions, but I want to make this working in jQuery.
It would be great if someone could help me to get this working !!
Thanks in advance
This is the raw template:
- <div class="mything">
- <ul>
- <li id="t232">
- Headitem 1
- </li>
- <li id="t241">
- Headitem 2
- </li>
- <li id="t250">
- Headitem 3
- </li>
- </ul>
-
- <div id="p232">
- Show if headitem 1 is clicked, hide if another headitem is clicked
-
- <div class="secondmenu items">
- <div class="name" id="s232-233">
- If hovered show c232-233
- </div>
-
- <div class="content" id="c232-233">
- some content
- </div>
- </div>
-
- <div class="secondmenu item">
- <div class="name" id="s232-256">
- If hovered show c232-256
- </div>
- <div class="content" id="c232-256">
- some content
- </div>
- </div>
-
- <div class="secondmenu item">
- <div class="name" id="s232-234">
- If hovered show c232-234
- </div>
- <div class="content" id="c232-234">
- some content
- </div>
- </div>
-
- </div>
-
-
- <div id="p241">
- Show if headitem 2 is clicked, hide if another headitem is clicked
-
- <div class="secondmenu items">
- <div class="name" id="s241-213">
- If hovered show c241-213
- </div>
- <div class="content" id="c241-213">
- some content
- </div>
- </div>
-
- <div class="secondmenu item">
- <div class="name" id="s241-256">
- If hovered show c241-256
- </div>
- <div class="content" id="c241-256">
- some content
- </div>
- </div>
-
- <div class="secondmenu item">
- <div class="name" id="s241-277">
- If hovered show c241-277
- </div>
- <div class="content" id="c241-277">
- some content
- </div>
- </div>
-
- </div>
-
- and so on
-
- </div>