Forum Moderators: open
<script type="text/javascript">
function showNav(ps_div_name, ps_image_name)
{
if(document.getElementById)
{
if(document.getElementById(ps_div_name))
{
if(document.getElementById(ps_div_name).style.display!= 'block')
{
document.getElementById(ps_div_name).style.display='block';
MM_swapImage(ps_image_name,'','/images/stories/minus_bullet.gif',1);
}
else
{
document.getElementById(ps_div_name).style.display='none';
MM_swapImage(ps_image_name,'','/images/stories/plus_bullet.gif',1);
}
}
}
}
</script>
so that is my script, and this is the link.
<a href="javascript:showNav('news2006','news2006nav');"><img src="http://www.focalscope.com/images/minusbullet.gif" name="news2006nav" border="0"></a>
the 'MM_swapImage' doesn't seem to show. the function is supposed to work as in when the link is clicked, it expands & the image changes. when clicked again, the image changes back to the original image.
I also find your logic a tad hard to understand.
IF your DIV is has a style of display:block you hide it before calling MM_swapImage function
If it's not a block, you make it a block before you call the MM_swapImage function, but don't hide it.
All very strange stuff, but then it would be wouldn't it? I haven't a clue what your MM_swapImage function does.