Make sure that camel case is passed in to currentStyle.
authorJohn Resig <jeresig@gmail.com>
Mon, 24 Jul 2006 03:56:46 +0000 (03:56 +0000)
committerJohn Resig <jeresig@gmail.com>
Mon, 24 Jul 2006 03:56:46 +0000 (03:56 +0000)
jquery/jquery.js

index 4f26b4c..9aac295 100644 (file)
@@ -1187,9 +1187,10 @@ jQuery.extend({
        
                if (!force && e.style[p])
                        r = e.style[p];
-               else if (e.currentStyle)
+               else if (e.currentStyle) {
+                       p = p.replace(/\-(\w)/g,function(m,c){return c.toUpperCase()}); 
                        r = e.currentStyle[p];
-               else if (document.defaultView && document.defaultView.getComputedStyle) {
+               } else if (document.defaultView && document.defaultView.getComputedStyle) {
                        p = p.replace(/([A-Z])/g,"-$1").toLowerCase();
                        var s = document.defaultView.getComputedStyle(e,"");
                        r = s ? s.getPropertyValue(p) : null;