Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/02/2011, 09:01
Avatar de salbatore
salbatore
 
Fecha de Ingreso: abril-2007
Ubicación: Springfield
Mensajes: 1.567
Antigüedad: 17 años
Puntos: 19
Respuesta: Misterio de la lectura CSS

Hola SergeMedina... que rapido...

He encontrado esta funcion... pensaba que no funcionaba... pero la estaba implementando mal... tenia que poner background-colo en vez de background... con esta funcion puedo saber el valor de un elemento al cargar la web con estilos en una hoja.

Código HTML:
Ver original
  1. function getStyle(oElm, strCssRule){
  2.     var strValue = "";
  3.     if(document.defaultView && document.defaultView.getComputedStyle){
  4.        strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
  5.     }
  6.     else if(oElm.currentStyle){
  7.         strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
  8.             return p1.toUpperCase();
  9.         });
  10.         strValue = oElm.currentStyle[strCssRule];
  11.     }
  12.     return strValue;
  13. }


Ahora miro tu link y te digo.