[jQuery] animating with unit '%'
I've been trying to create animations with width values in percent.
For instance, I have a div wrapper around my page called wrap, and I'm
trying to be able to toggle it's width with .animate() from 770px wide
to 100% wide. For the most part I'd like to keep it as an animation,
so it fluidly expands or contracts from one value to the other. I can
achieve this easily using .css() or .width(), however I can't seem to
figure out how to imply percent values within .animate().
$('#wrap').animate({style: 'width: 100%'},1000);
This returns 100px.
Closest I could get was:
$('#case').animate({ opacity: 'show'}, "slow").width('100%'); //or
width(770)
All this does though is blink's the opacity, and show's the new value,
however it does keep the value intact with units in percent.