Meka][Meka Unstopable Posts: 700
| i jus coded this for my site, so its not usable as is, a few changes and you can use it for your sites... it can help u create quick drop down tables and rows etc... handy..
Code: | <script type="text/javascript"> //function designed to hide/unhide table rows [tr] will work with other elements also. //Meka][Meka (c) 2007. function SubMenuClick(itemname) { i = 1; var ob = document.getElementById(itemname + '1'); while (ob != null) { if (ob.style.display == 'block') { ob.style.display = 'none'; } else { ob.style.display = 'block'; } i++; var ob = document.getElementById(itemname + i); } } </script> <tr onClick="javascript:SubMenuClick('<?php echo $row['subcat']; ?>')"> <td> <?php echo $row['subcat']; ?> </td> </tr> <tr id="<?php echo $row['subcat']; ?>1" style="display:none"> <td> Product Cat Here </td> </tr> <tr id="<?php echo $row['subcat']; ?>2" style="display:none"> <td> Product Cat Here </td> </tr> | ; MEKA ;
|