We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 23e8cc5 + 735a949 commit ee81d4dCopy full SHA for ee81d4d
src/css.js
@@ -248,11 +248,14 @@ jQuery(function() {
248
get: function( elem, computed ) {
249
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
250
// Work around by temporarily setting element display to inline-block
251
- var ret = "0px",
252
- display = elem.style.display;
253
- elem.style.display = "inline-block";
254
- ret = getComputedStyle( elem, "margin-right", "margin-right" );
255
- elem.style.display = display;
+ var ret;
+ jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ ret = curCSS( elem, "margin-right", "marginRight" );
+ } else {
256
+ ret = elem.style.marginRight;
257
+ }
258
+ });
259
return ret;
260
}
261
};
0 commit comments