From: John Resig Date: Mon, 24 Jul 2006 03:56:46 +0000 (+0000) Subject: Make sure that camel case is passed in to currentStyle. X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=0a4dc3f8f295d10bbe855a11f52931c6c979e29e;hp=9e37da96d12c0f35c766a4724c5d565d0a50ab42;p=jquery.git Make sure that camel case is passed in to currentStyle. --- diff --git a/jquery/jquery.js b/jquery/jquery.js index 4f26b4c..9aac295 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -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;