hello,
Im still trying to get my head round JS and am having difficulty.
I have the following code in the head:
and this in the body around the image
So if the image is clicked the hidden row is shown. and the onclick also changes the image to the rollover.
NOW,.... when the button is pressed again the row is hidden, but image does not revert back to the original image!
can you help?
Im still trying to get my head round JS and am having difficulty.
I have the following code in the head:
Code:
function swapImage_new(sImg,sRImage)
{
document.images[sImg].src=sRImage;
}
function showtext(x)
{
if (document.getElementById(x).style.display == 'none')
{
document.getElementById(x).style.display = 'block';
}
else
{
document.getElementById(x).style.display = 'none';
}
}
</script>
and this in the body around the image
Code:
<tr>
<td><img src="../images/faqs_head_1.gif" Onclick="showtext('row1'); this.src='../images/faqs_head_R_1.gif';return true;" style="display:block;"></td>
<tr id="row1" style="display:none;">
<td class="content" style="padding-left:23px"></td>
</tr>
So if the image is clicked the hidden row is shown. and the onclick also changes the image to the rollover.
NOW,.... when the button is pressed again the row is hidden, but image does not revert back to the original image!
can you help?