I\'m looking for a way using jQuery to return an object of computed styles for the 1st matched element. I could then pass this object to another call of jQuery\'s css method
It's not jQuery but, in Firefox, Opera and Safari you can use window.getComputedStyle(element)
to get the computed styles for an element and in IE<=8 you can use element.currentStyle
. The returned objects are different in each case, and I'm not sure how well either work with elements and styles created using Javascript, but perhaps they'll be useful.
In Safari you can do the following which is kind of neat:
document.getElementById('b').style.cssText = window.getComputedStyle(document.getElementById('a')).cssText;