Forum Moderators: open
<script>
function showHide(elementid){
if (document.getElementById(elementid).style.display == 'none'){
document.getElementById(elementid).style.display = '';
} else {
document.getElementById(elementid).style.display = 'none';
}
}
</script>
I don't know how cross browser it is. NN4 won't see it. Then you need to style the element with display:none. Then have what ever is calling it pass the id of the hidden element as an aurgument.
Have the div:
<div id="nameOfDiv" style="display:none">text</div>
then the switcher event:
<a href="javascript:showHide('nameOfDiv');">show layer</a>
It looks pretty sharp. I just expanded my javascript to take a few extra calls. I also included the id and style attribute in a bold tag. It looks like this:
<b id="arrow1" style='display: block'>►</b><b id="darrow1" style='display: none'>▼</b>
I guess I could have used the div but sometimes those get irritating because they don't position correctly for me cross browser, and I thought this would be much more simple.
Thanks for the tips.