Forums

This topic is locked

advanced show/hide layer question

Posted 16 Sep 2007 19:20:17
1
has voted
16 Sep 2007 19:20:17 marilyn banister posted:
Here is the website so far www.depthwork.com/test/cardtest.html What i want to do is when the user selects a card in the list/menu area, the corresponding pic dissappears. The code I am using is this...which works but with one glitch.

head=
function cmx_listMenuShowHide(sel){
for(var i=0;i<sel.options.length;i++){
if(sel.options[i].selected){
MM_showHideLayers(sel.options[i].value,'','hide');
}
else{
MM_showHideLayers(sel.options[i].value,'','show');
}
}
}

body=
<select name="life1" id="life1" onchange="cmx_listMenuShowHide(this);">
<option>Select here</option>
<option value="connected to others ">cross</option>
<option value="self-reliant ">circle</option>
<option value="going through a transition">spiral</option>
<option value="goal-oriented">triangle</option>
<option value="responsible and reliable">square</option>
</select>

Here is my problem.....I need the values to have different names than the layers because the value goes into the page with the result reading. This code will only work if the value and the layer are the same (cant use spaces in layer naming). I am not an expert as you can see in writing code. I dont even know if this is the proper way to do it.

Basically I just want whatever choice they make in the list/menu to make the corresponding card dissappear.

I made this at first in flash but have an issue I cant resolve so I am now trying it this way.

Any help will be greatly appreciated in advance,
Marilyn

Reply to this topic