Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/06/2011, 04:41
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Leer visibility

Podés usar esto para leer estilos computados (en el mismo archivo o en hojas de estilo externas):
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>Documento sin título</title>
<style type="text/css">
#midiv{ visibility:hidden}
</style>
<script type="text/javascript">
function getCSS(o,prop){
    if(window.getComputedStyle){
        return document.defaultView.getComputedStyle(o,null).getPropertyValue(prop); 
    }else{ 
        var re = /(-([a-z]){1})/g; 
        if (prop == 'float') prop = 'styleFloat'; 
        if (re.test(prop)) { 
            prop = prop.replace(re, function () { 
                return arguments[2].toUpperCase(); 
            }); 
        } 
        return o.currentStyle[prop] ? o.currentStyle[prop] : null; 
    } 
}  
onload=function(){
	alert(getCSS(document.getElementById('midiv'),'visibility'));	
}
</script>

</head>

<body>
<div id="midiv">Colocar aquí el contenido para  id "midiv"</div>
</body>
</html>