Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/09/2010, 15:10
Avatar de Perr0
Perr0
 
Fecha de Ingreso: mayo-2005
Ubicación: Santiago de Chile, Chile
Mensajes: 676
Antigüedad: 18 años, 10 meses
Puntos: 79
Respuesta: dejar un solo div abierto en internet explorer

create una pagina con este codigo

luego adaptalo
es lo mismo pero funciona aqui, con IE y FF

la cosa es que te lee la funcion click, si detecta un div y tiene Id lo tira a display="none"

Lo mas probable es que tengas todos los divs contenidos en uno, habria que hacer un arreglo

Código HTML:
<!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=iso-8859-1" />
<title>Documento sin título</title>
<script>
document.onclick=function (e){
    if (e && e.target)
	foco=e.target
	else
	foco=document.activeElement
	if(foco.tagName!="DIV" || !foco.id){
		alert("solo funciona con divs y tienen que tener \"Id\"\n despues deje este alert como comentario\n\nsu amigo Perr0")
		return false
	}
	var divs=document.getElementsByTagName("div")
	for(i=0;i<divs.length;i++)
	if(foco.id!=divs[i].id) divs[i].style.display="none"
}
</script>
<style>
div{
	width:160px;
	height:100px;
	position:absolute;
	padding:5px;
}
.c1{
	border:3px solid red;
	background-color:#093;
}
.c2{
	border:3px solid blue;
	background-color: #FF0;
}
</style>
</head>

<body>
<div id="div1" class="c1" style="left:184px; top: 184px"></div>
<div id="div2" class="c1" style="left:111px; top: 27px"></div>
<div id="div3" class="c2" style="left:438px; top: 42px"></div>
<div id="div4" class="c2" style="left:580px; top: 116px"></div>
<div class="c2" style="left:751px; top: 133px"></div>
</body>
</html>