aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2006-07-24 03:56:46 +0000
committerJohn Resig <jeresig@gmail.com>2006-07-24 03:56:46 +0000
commit0a4dc3f8f295d10bbe855a11f52931c6c979e29e (patch)
tree5b2f8856dc39187dac0304f1753781749f433ae9
parent9e37da96d12c0f35c766a4724c5d565d0a50ab42 (diff)
downloadjquery-0a4dc3f8f295d10bbe855a11f52931c6c979e29e.tar.gz
jquery-0a4dc3f8f295d10bbe855a11f52931c6c979e29e.zip
Make sure that camel case is passed in to currentStyle.
-rw-r--r--jquery/jquery.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jquery/jquery.js b/jquery/jquery.js
index 4f26b4c15..9aac295b2 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;