Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/04/2010, 07:39
ferra99
 
Fecha de Ingreso: abril-2010
Mensajes: 3
Antigüedad: 14 años
Puntos: 0
Respuesta: Problema con capas

Muchas gracias emprear, llego a funcionar, ahora viene donde esta el mayor trabajo, ya que habra 6 botones y cada uno enseñara una capa y escondera las otras 5, lo he hecho todo asi:
Código:
function mostrarcapa(layer){
	var nom=document.getElementById(layer).getAttribute(Id);
	if(nom=="argenta"){
		document.getElementById("argenta").style.display="none";
		document.getElementById("nanet").style.display="block";
		document.getElementById("jai").style.display="block";
		document.getElementById("cuseta").style.display="block";
		document.getElementById("moro").style.display="block";
		document.getElementById("elena").style.display="block";
		}
	if(nom=="nanet"){
		document.getElementById("argenta").style.display="block";
		document.getElementById("nanet").style.display="none";
		document.getElementById("jai").style.display="block";
		document.getElementById("cuseta").style.display="block";
		document.getElementById("moro").style.display="block";
		document.getElementById("elena").style.display="block";
		}
	if(nom=="jai"){
		document.getElementById("argenta").style.display="block";
		document.getElementById("nanet").style.display="block";
		document.getElementById("jai").style.display="none";
		document.getElementById("cuseta").style.display="block";
		document.getElementById("moro").style.display="block";
		document.getElementById("elena").style.display="block";		
		}
	if(nom=="cuseta"){
		document.getElementById("argenta").style.display="block";
		document.getElementById("nanet").style.display="block";
		document.getElementById("jai").style.display="block";
		document.getElementById("cuseta").style.display="none";
		document.getElementById("moro").style.display="block";
		document.getElementById("elena").style.display="block";		
		}
	if(nom=="moro"){
		document.getElementById("argenta").style.display="block";
		document.getElementById("nanet").style.display="block";
		document.getElementById("jai").style.display="block";
		document.getElementById("cuseta").style.display="block";
		document.getElementById("moro").style.display="none";
		document.getElementById("elena").style.display="block";		
		}
	if(nom=="elena"){
		document.getElementById("argenta").style.display="block";
		document.getElementById("nanet").style.display="block";
		document.getElementById("jai").style.display="block";
		document.getElementById("cuseta").style.display="block";
		document.getElementById("moro").style.display="block";
		document.getElementById("elena").style.display="none";		
		}
}

y el html es:
Código:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Mostrar - Ocultar Capas</title>
<script type="text/javascript" src="capes.js"></script>
</head>

<body>
<a href="#" onclick="javascript:capes('nanet')">Mostrar-Ocultar</a>
<div id="nanet">Colocar aquí el contenido para  id "nanet"</div>
<a href="#" onclick="javascript:capes('jai')">Mostrar-Ocultar</a>
<div id="jai">Colocar aquí el contenido para  id "jai"</div>
<a href="#" onclick="javascript:capes('cuseta')">Mostrar-Ocultar</a>
<div id="cuseta">Colocar aquí el contenido para  id "cuseta"</div>
<a href="#" onclick="javascript:capes('moro')">Mostrar-Ocultar</a>
<div id="moro">Colocar aquí el contenido para  id "moro"</div>
<a href="#" onclick="javascript:capes('elena')">Mostrar-Ocultar</a>
<div id="elena">Colocar aquí el contenido para  id "elena"</div>
<a href="#" onclick="javascript:capes('argenta')">Mostrar-Ocultar</a>
<div id="argenta">Colocar aquí el contenido para  id "argenta"</div>
</body>

</html>
Pero no funciona... veis el problema?
hay alguna forma de ejecutar el script linea a linea para ver donde esta el error?

Gracias por vuestra paciencia!