aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-08-16 19:25:32 -0400
committerDave Methvin <dave.methvin@gmail.com>2011-08-16 19:25:32 -0400
commit727d51ec9df1dadd742fc468ca3e003da172fb1b (patch)
treefddbfc033cb63a8b636ede0b833c42ea3b488b21 /src/css.js
parent015328787cd2e52efbc77d1254ebcac13cc4ac53 (diff)
downloadjquery-727d51ec9df1dadd742fc468ca3e003da172fb1b.tar.gz
jquery-727d51ec9df1dadd742fc468ca3e003da172fb1b.zip
Save a few bytes, thanks @danheberden!
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/css.js b/src/css.js
index da0dd20c8..e5a93fce1 100644
--- a/src/css.js
+++ b/src/css.js
@@ -6,7 +6,7 @@ var ralpha = /alpha\([^)]*\)/i,
rupper = /([A-Z]|^ms)/g,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
- rrelNum = /^([+\-])=([+\-\.\de]+)/,
+ rrelNum = /^([-+])=([-+.\de]+)/,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssWidth = [ "Left", "Right" ],
@@ -85,7 +85,7 @@ jQuery.extend({
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = (ret[1] === "+"? +ret[2] : -ret[2]) + parseFloat( jQuery.css( elem, name ) );
+ value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}