| 604 | // Generate parameters to create a standard animation |
| 605 | |
| 606 | function genFx(type, includeWidth) { |
| 607 | var which, |
| 608 | attrs = { |
| 609 | height: type |
| 610 | }, |
| 611 | i = 0; |
| 612 | |
| 613 | // if we include width, step value is 1 to do all cssExpand values, |
| 614 | // if we don't include width, step value is 2 to skip over Left and Right |
| 615 | includeWidth = includeWidth ? 1 : 0; |
| 616 | for (; i < 4; i += 2 - includeWidth) { |
| 617 | which = cssExpand[i]; |
| 618 | attrs["margin" + which] = attrs["padding" + which] = type; |
| 619 | } |
| 620 | |
| 621 | if (includeWidth) { |
| 622 | attrs.opacity = attrs.width = type; |
| 623 | } |
| 624 | |
| 625 | return attrs; |
| 626 | } |
| 627 | |
| 628 | // Generate shortcuts for custom animations |
| 629 | jQuery.each({ |