Re: [css3-transitions] transitioning to/from auto value

On Apr 28, 2010, at 10:25 AM, Brad Kemper wrote:

> On Apr 28, 2010, at 10:22 AM, Brad Kemper wrote:
> 
>>> In Gecko that's not necessarily the case at all.  Note that the key is that style changes are coalesced; they are NOT processed when you make the .style.whatever change but at some later point in time. 
>> 
>> Hmm. Maybe instead of just snapshotting the values, you also let other properties continue to change that snapshot of what "auto" means. Don't you have to do that sort of thing anyway for other values, such as percentages or ems/font-size? For instance:
>> 
>> div#x {
>> transition: margin-right 1s;
>> margin-right : 0;
>> width: 100px;
>> }
>> 
>> Then I have:
>> 
>> <div>
>> 	<!-- The parent node is inside a 1000px padding box -->
>> 	<div id="x">This is some text that is 150px wide</div>
>> </div>
>> 
>> and this script:
>> 
>> var divX = document.getElementById("x");
>> divX.style.marginRight = "50%";
>> divX.parentNode.style.width = "200px";
> 
> What I mean, in case I wasn't clear, is that, just as you have to update the "to" part of the transition for what percentage means here, so too could you update the "to" part of the transition for what "auto" means to height.

No, in this cause you're just interpolating the right margin between 0% and 50% during the transition.

Simon

Received on Wednesday, 28 April 2010 17:30:12 UTC