M
M.L.
The expand/collapse script I'm using expands a DIV block just fine in
IE, Firefox and Opera but neither can collapse the block back to its
original condition. I'm rusty with JS and would like to know if I'm
missing some basic steps or concepts needed to get it to work as
expected. The steps I've taken regarding CSS, HTML and JS are as
follows:
*****************************
CSS:
... #menuForm {visibility:hidden;display:none;} ...
*****************************
HTML:
....<span onClick="showHide('menuForm')" class="text10">Some text
here</span>...
....
<div id="menuForm">
<form... ><TABLE ...>...</table></form>
</div>
*****************************
JS:
function showHide(obj)
{
var DOC = document.getElementById(obj);
if (DOC.visibility='hidden')
{
DOC.style.visibility='visible';
DOC.style.display='block';
}
else
{
DOC.visibility='hidden';
DOC.style.display='none';
}
}
*****************************
I strategically placed some alerts at the top and bottom of each JS
conditional and found that the visibility value never changes and
remains set to 'hidden' even after the DIV has become visible, and the
display value is always set to 'none'. Therefore, the code never gets to
the *hiding* portion of the script. I'm wondering if the CSS setting is
keeping those values constant. Any assistance on this issue will be
greatly appreciated. Thanks.
IE, Firefox and Opera but neither can collapse the block back to its
original condition. I'm rusty with JS and would like to know if I'm
missing some basic steps or concepts needed to get it to work as
expected. The steps I've taken regarding CSS, HTML and JS are as
follows:
*****************************
CSS:
... #menuForm {visibility:hidden;display:none;} ...
*****************************
HTML:
....<span onClick="showHide('menuForm')" class="text10">Some text
here</span>...
....
<div id="menuForm">
<form... ><TABLE ...>...</table></form>
</div>
*****************************
JS:
function showHide(obj)
{
var DOC = document.getElementById(obj);
if (DOC.visibility='hidden')
{
DOC.style.visibility='visible';
DOC.style.display='block';
}
else
{
DOC.visibility='hidden';
DOC.style.display='none';
}
}
*****************************
I strategically placed some alerts at the top and bottom of each JS
conditional and found that the visibility value never changes and
remains set to 'hidden' even after the DIV has become visible, and the
display value is always set to 'none'. Therefore, the code never gets to
the *hiding* portion of the script. I'm wondering if the CSS setting is
keeping those values constant. Any assistance on this issue will be
greatly appreciated. Thanks.