Hi all,
I have a simple problem. I have this javascript code which I'm using for collapsible tables:
<html>
<head>
<script type="text/javascript">
function getItem(id)
{
var itm = false;
if(document.getElementById) { itm = document.getElementById(id); }
else if(document.all) { itm = document.all[id]; }
else if(document.layers) { itm = document.layers[id]; }
return itm;
}
function toggleItem(id)
{
itm = getItem(id);
if(!itm) { return false; }
if(itm.style.display == 'none') { itm.style.display = ''; } //display minus.gif
else { itm.style.display = 'none'; } //display plus.gif
return false;
}
</script>
</head>
<body>
<table width="100%">
<tr>
<td><img src="/images/add.gif" href="javascript:;" onclick="toggleItem('info')" align="left">Backup Information:</td>
</tr>
<tbody id="info">
<tr class="headers">
<td><strong>Backup Date:</strong></td>
</tr>
<tr>
<td><?php echo $formatted_date; ?></td>
</tr>
</tbody>
</table>
</body>
</html>
So what I'm trying to do is display the image /path/to/plus when the table is closed, and then display the image /path/to/minus when the table is open.
Can anyone help me?
Thanks, ns