Skip to content
Permalink
Browse files

Small optimization to jQuery.prop, saving 2 or 3 bytes

  • Loading branch information
jzaefferer committed Feb 3, 2007
1 parent 43f235f commit fd0f42bf5cf18d311db78680e4d28bc6ff1b016c
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/jquery/jquery.js
@@ -1281,10 +1281,9 @@ jQuery.extend({
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;

// Handle passing in a number to a CSS property
if ( value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
return value + "px";

return value;
return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ?
value + "px" :
value;
},

className: {

0 comments on commit fd0f42b

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