jquery animate to % relative position

jquery animate to % relative position


Hi,
I am currently working on a site where we are implementing a fluid
layout with the heavy use of percentages so it works over multiple
resolutions. As part of the site we wish to animate objects coming
onto the screen and ending in a certain position.
We have the CSS for the objects final positions with various 'top'
values, e.g. the first object has: "top: -25.5%" and we wish to
animate that div from below the screen (in our case this can be a
start point of: top:0% due to its relativity) and the end animation
to have the value shown above.
I would have thought that the correct syntax to achieve this result
would have been:
$('#myDiv').animate({top:'-25.5%'})
However in the case above, the animate function simply makes the
result in px, so the objects style ends up with : "top: 25.5px".
I actually sent a query to John Resig on twitter about this and
recieved a DM reply telling me to try for example:
$('#myDiv').animate({top:'-=25%'})
However this just seems to set the resulting style to 0px regardless
of the objects start position, percentage or its -=, += notation.
Any help or comments would be appreciated.