Heey there jQuery community :)
I have a problem, which I hope you can solve.
I'm using jQuery this time to create a dropdown menu.
Here is my html code (partially, only the relevant part):
- <table>
- <tr>
- <th><a href="#">Info</a></th>
- </tr>
- <tr><td>Products</td></tr>
- <tr><td>Prices</td></tr>
- <tr><td>Location</td></tr>
- <tr><td>F.A.Q.</td></tr>
- </table>
Here is the relevant part of the css:
- td {
- display: none;
- }
Now what I want should be obvious: When you hover the <th>, the other <td> should display, and onmouseout they should dissapear of course.
Here is the jQuery I came up with but which doesn't work so far:
- $(document).ready(function() {
-
- $("table").hover(function() {
- $(this).children().children().show();
- }, function() {
- $(this).children().children().hide();
- });
-
- });
The children() part probably doesn't make too much sense but I've accomplished many things spamming parents and children :P
Can someone please help me out by telling me how to properly select all the td's and showing them?
Thanks in advance!
Greets,
Rien Heuver