Help nuB with show/hide script

T

Targa

On my site I have pages with 2 a column table. The left column contains the
site menu and the right column contains the page content. Ive got a script
that hides the menu with an onClick action. This works fine but Im trying to
figure out how I can have it remember if the menu was hidden or not when the
user goes on to another page. Im thinking maybe via cookie but I cant figure
it out.

Code below,

Any help greatly appreciated - thanks in advance!

<table><tr>
<DIV ID="layer1" style="position:relative;width:190;overflow:hidden">
<td>menu stuff....</td></DIV>
<td>content...
<img src="img/arrow_left.gif" name="arrow3"
onClick="{ToggleHide(1,arrow1) }" alt="Hide Menu" hspace="0" vspace="4">
</td>
</tr></table>

<!-- SHOW/HIDE LEFT MENU -->
<SCRIPT LANGUAGE="JavaScript">

var name = new Array(100);
name[1] = "layer1";
name[2] = "layer2";
name[3] = "layer3";
name[4] = "layer4";
name[5] = "layer5";
name[6] = "layer6";
function changeArrow(arrow, down) {
if (down == false){
arrow.src = 'img/leftarr.gif';
arrow.alt='Hide Menu';

}
else{
arrow.src = 'img/rightarr.gif';
arrow.alt='Show Menu';

}
}

function ToggleHide(value, arrow) {
if (document.layers) {
if (document.layers[name[value]].visibility=='show'){
document.layers[name[value]].visibility='hide';
document.layers[name[value]].width = 0;
changeArrow(arrow,false);
}
else{
document.layers[name[value]].visibility='show';
document.layers[name[value]].width = 190;
changeArrow(arrow,true);
}
}
else {
if (document.all[name[value]].style.visibility == 'hidden'){
document.all[name[value]].style.visibility='visible';
document.all[name[value]].style.width = 190;
document.all[name[value]].style.overflow='visible';
changeArrow(arrow,false);
}
else{
document.all[name[value]].style.visibility='hidden';
document.all[name[value]].style.width = 0;
document.all[name[value]].style.overflow='hidden';
changeArrow(arrow,true);
}
}
}
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top