Skip to content
Permalink
Browse files

Further fix for #3333, refactored marginRight css hook to use jQuery.…

…swap and computed. Thanks timmywil
  • Loading branch information...
rdworth committed Mar 24, 2011
1 parent 7b985c4 commit 735a949a0649f0299e8e4d87b259290970a68ddf
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/css.js
@@ -248,11 +248,14 @@ jQuery(function() {
get: function( elem, computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
var ret = "0px",
display = elem.style.display;
elem.style.display = "inline-block";
ret = getComputedStyle( elem, "margin-right", "margin-right" );
elem.style.display = display;
var ret;
jQuery.swap( elem, { "display": "inline-block" }, function() {
if ( computed ) {
ret = curCSS( elem, "margin-right", "marginRight" );
} else {
ret = elem.style.marginRight;
}
});
return ret;
}
};

0 comments on commit 735a949

Please sign in to comment.
You can’t perform that action at this time.