Transition to/from width:auto and height:auto properly#141
Transition to/from width:auto and height:auto properly#141NV wants to merge 1 commit intorstacruz:masterfrom
Conversation
|
Rationale: CSS transition from/to auto values. |
|
Whoa, interesting. This means Transit can also replace |
|
If anyone can help review this, please post your feedback here. |
|
It should be feasible to implementing .slideUp() / .slideDown() using this technique. Although. I haven’t actually tried. |
|
I noticed this as well. If you animate to an "auto" width/height it goes to 0 and then finally sets to that value. Workaround is to (for example) ... on a DIV: $('#somediv').transition( { 'height': $('#somediv')[0].scrollHeight+'px' }, 300, function () {
$('#somediv').css( { 'height': 'auto' } );
} ); |
Only tested in Chrome 29, Safari 6.0.5 and Firefox 21.0 so far.
|
Still relevant, I just rebased from the upstream. @benguild this pull-request does it without the workaround. |
|
💯 👍 I have no idea why this works but I can verify that it does indeed work. Check out the jsFiddle Please merge this! Can't wait to replace |
|
PS I briefly tried to redefine |
|
@NV I think your branch breaks the fx queue for opacity animations (somehow, not sure how). Here's a js fiddle, try out the opacity transition. I've found (bizarrely) that double-clicking it seems to make it transitions work (kinda). Here's the same fiddle but with current master. Notice the difference in the opacity transition. Since I have no idea how your patch works, I'm at a loss as to how I might fix it. |
|
Still not merged? wah 😒 |
Only tested in Chrome 29, Safari 6.0.5 and Firefox 21.0 so far.