Permalink
Browse files

tweak genFx to satisfy gzip

  • Loading branch information...
1 parent 2257f13 commit 38d5eefb4710c26c10af7b787bb6ef83cbae89cb @gibson042 gibson042 committed Apr 21, 2012
Showing with 11 additions and 10 deletions.
  1. +11 −10 src/effects.js
View
@@ -532,27 +532,28 @@ jQuery.fn.extend({
// Generate parameters to create a standard animation
function genFx( type, includeWidth ) {
- var attrs = { "height" : type },
+ var which,
+ attrs = { height: type },
i = 0;
- if( includeWidth ){
- attrs.width = type;
- attrs.opacity = type;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = jQuery.cssExpand[ i ];
+ attrs[ "margin" + which ] = type;
+ attrs[ "padding" + which ] = type;
}
- for( ; i < 4 ; i += 2 - includeWidth ) {
- attrs[ "margin" + jQuery.cssExpand[ i ] ] = type;
- attrs[ "padding" + jQuery.cssExpand[ i ] ] = type;
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
}
return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
- slideDown: genFx( "show" ),
- slideUp: genFx( "hide" ),
- slideToggle: genFx( "toggle" ),
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }

0 comments on commit 38d5eef

Please sign in to comment.