PDA

View Full Version : Javascript questions about "onclick"...


Antivirus
07-16-2006, 04:52 AM
If there's any java gurus that can help, please let me know how to do following:

When user clicks on "Foo" or "Bar" in thead cell, display either FOO tablerow, or BAR table row. This works as I would like, however I want to add following functionality:

1) Whenever the page is re-loaded, reset thingies so FOO is displayed, and BAR hidden

2) When displaying FOO, i would like to hide BAR, and likewise, when displaying BAR, I would like to hide FOO.

Here's my code...

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="thead">
<a href="#top" onclick="return toggle_collapse('FOO')"><span id="collapsetxt_FOO">Tracklisting</span></a>&nbsp;/&nbsp;
<a href="#top" onclick="return toggle_collapse('BAR')"><span id="collapsetxt_BAR">Description</span></a>
</td>
</tr>
</thead>
<tbody id="collapseobj_FOO" style="$vbcollapse[collapseobj_FOO]">
<tr>
<td class="alt2">
Foo Text
</td>
</tr>
</tbody>
<tbody id="collapseobj_BAR" style="$vbcollapse[collapseobj_BAR]">
<tr>
<td class="alt2">
Bar Text
</td>
</tr>
</tbody>
</table>



Thanks in advance!