Ver Mensaje Individual
  #13 (permalink)  
Antiguo 13/12/2010, 16:06
Avatar de IsaBelM
IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 11 meses
Puntos: 1012
Respuesta: Mostrar dive segun llamada

perdona, me surgió algo. esto es lo que he hecho a bote pronto. si tienes alguna pregunta ...
Cita:
<html>
<head>
<title>.:: ::..</title>
<script type="text/javascript">
window.onload = function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].onclick = function() {
for (var n = 0; n < links.length; n++) {
document.getElementById(links[n].name).style.display = (this.name == links[n].name) ? 'block' : 'none';
}
return false;
}
}
}
</script>
</head>

<body>
<a href="#" name="div_1">Uno</a>
<br>
<a href="#" name="div_2">Dos</a>
<br>
<a href="#" name="div_3">Tres</a>
<div id="div_1" style="display:none">Primer contenido</div>
<div id="div_2" style="display:none">Ahora vemos el segundo contenido</div>
<div id="div_3" style="display:none">y finalmente vemos el tercer contenido</div>




</body>




</html>