S
shapper
Hello,
I have the following function:
I have 6 divs with Ids 'dHome', 'dBiografia', ...
And 6 anchors with Ids 'aHome', 'aBiografia', ...
So when I do show('Home') I want to:
1. Show dHome and hide all the other divs from the list
2. Hide aHome and show all the other anchors from the list
How to change my code to accomplish this?
Thanks,
Miguel
I have the following function:
Code:
function show(id) {
var allIds = ['Home', 'Biografia', 'Fotografias',
'EntreJaneiros', 'Trabalhos', 'Hiperligacoes'], ids, i=0;
while(ids = allIds[i++])
{ document.getElementById(ids).style.display=ids==id?'block':'none';
}
}
I have 6 divs with Ids 'dHome', 'dBiografia', ...
And 6 anchors with Ids 'aHome', 'aBiografia', ...
So when I do show('Home') I want to:
1. Show dHome and hide all the other divs from the list
2. Hide aHome and show all the other anchors from the list
How to change my code to accomplish this?
Thanks,
Miguel