Make sure that camel case is passed in to currentStyle.

1.7/enhancement_8685
John Resig 2006-07-24 03:56:46 +00:00
parent 9e37da96d1
commit 0a4dc3f8f2
1 changed files with 3 additions and 2 deletions

5
jquery/jquery.js vendored
View 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;