jquery/jquery — pull request #808 by jefferyto (2012-06-03 09:13:33+00:00)
Title: Fixes Bug 7109

As gnarf mentions in the [bug report](http://bugs.jquery.com/ticket/7109#comment:7), there is precision error in the non-px start value that jQuery computes before animating.

In [this example](http://jsfiddle.net/jefferyto/Gd5dn/), the start width is 33.33333%, which in my Chrome 19 (Linux) is 94px. When jQuery does this:

if ( unit !== "px" ) {
jQuery.style( this, p, (end || 1) + unit);
start = ( (end || 1) / e.cur() ) * start;
jQuery.style( this, p, start + unit);
}

the element width becomes 2px (Firefox rounds the width to 3px which seems a bit more reasonable). `start` becomes 47 (1/2 * 94) and the element is assigned a width of 47% (133px).

This fix does the computation twice, using the "close but not quite" value from the first computation as input for the second. I made a [calculator](http://jsfiddle.net/jefferyto/fexWp/) to see what effect this would have (as well as a potential third computation), and it seems the result is much more accurate.