Dos años de retraso, pero tengo la solución que estás buscando. Sin la intención de obtener crédito del autor original , aquí hay un complemento que encontré funciona excepcionalmente bien para lo que necesita, pero obtiene todos los estilos posibles en todos los navegadores, incluso IE.
Advertencia: este código genera muchos resultados y debe usarse con moderación. No solo copia todas las propiedades CSS estándar, sino también todas las propiedades CSS del proveedor para ese navegador.
jquery.getStyleObject.js:
/*
* getStyleObject Plugin for jQuery JavaScript Library
* From: http://upshots.org/?p=112
*/
(function($){
$.fn.getStyleObject = function(){
var dom = this.get(0);
var style;
var returns = {};
if(window.getComputedStyle){
var camelize = function(a,b){
return b.toUpperCase();
};
style = window.getComputedStyle(dom, null);
for(var i = 0, l = style.length; i < l; i++){
var prop = style[i];
var camel = prop.replace(/\-([a-z])/g, camelize);
var val = style.getPropertyValue(prop);
returns[camel] = val;
};
return returns;
};
if(style = dom.currentStyle){
for(var prop in style){
returns[prop] = style[prop];
};
return returns;
};
return this.css();
}
})(jQuery);
El uso básico es bastante simple, pero también ha escrito una función para eso:
$.fn.copyCSS = function(source){
var styles = $(source).getStyleObject();
this.css(styles);
}
Espero que ayude.