Wednesday, 4 January 2017
javascript - Animate width to fit-content
Answer
I need to animate a div
from a width of 0
(initial) to a width fit-content
(a width that is the same as the width of its content)
$('div').css('width', 'fit-content');
However, if I do this the animation
transition: width .5s ease-in-out;
doesn't work anymore. So the question is how can I animate just to fit the content ?
Subscribe to:
Post Comments (Atom)
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
A fair amount of the second act of The Dark Knight Rises has a class warfare plotline. This is foreshadowed in the trailers with Selina Ky...
-
I want to create an options array from a string. How can i create an array as { width : 100, height : 200 } from a string ...
-
I'm trying to set the size of a CardView inside of a DialogFragment , but I get this error: java.lang.NullPointerException: Attempt t...
No comments:
Post a Comment