Relative animation with multiplication

Relative animation with multiplication

I posted this idea in the jQuery Core forums; but now that I think about it, it might be better to propose the idea here since the UI adds more animation features/effects. I'm not sure how the UI core would make these changes to jQuery (I haven't looked at the UI core yet), but here is my idea.

I was trying to use the core animation to reduce a set of elements in size and I think it would be nice to have a token that does multiplication. For example:
  1. $(selector).animate({
  2.   width    : '*=0.8',
  3.   height   : '*=0.8',
  4.   fontSize : '*=0.8'
  5. }, 1000, function() {
  6.   // callback
  7. });
The above code would reduce the object's height, width and font size by 80%. The proposed change to jQuery would replace code starting at line 6485 (jQuery v1.4.4).
  1. // If a +=/-= token was provided, we're doing a relative animation
  2. if ( parts[1] ) {
  3.   if (parts[1] === "*=") {
  4.     end = start * end;
  5.   } else {
  6.     end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
  7.   }
  8. }