Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/04/2010, 11:27
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Problema con capas

Prueba con lo siguiente:

Código para mostrarcapa.js

Código:
/* ---------------------------- */
/* MostrarOcultar Capas			*/
/* ---------------------------- */
function mostrarcapa(layer){
	var miCapa=document.getElementById(layer).style.display;
	if(miCapa=="none"){
		document.getElementById(layer).style.display="block";
	} else { 
		document.getElementById(layer).style.display="none";
		}
}

Código para mostrarcapas.html


Código:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Mostrar - Ocultar Capas</title>
<script type="text/javascript" src="mostrarcapa.js"></script>
</head>

<body>
<div id="capauno">Ferra99</div>
<a href="#" onclick="javascript:mostrarcapa('capauno')">Mostrar-Ocultar</a>
</body>
</html>
El ejemplo funcionando lo puedes ver en http://foros.emprear.com/mostrarcapas/mostrarcapas.html

Saludos