0

I have a group of div box's that will be displayed at different times based on what is clicked. It needed to be animated to slide down. For this, I change the height of the each div at a certain time, then the CSS3 Transition takes over and eases it down.

Now at the moment, if I provide the height for the box to change to, it works fine, but I can't always provide that as the content is dynamic and may be however tall. But when I define auto as the height, then the transition takes it up to 0, then sizes to the content. How can I get it to instead of slide to 0, slide to the height of the div based on the content?

1 Answer 1

1

sadly after much searching, found out that its not possible to do it to auto, but my solution was to find the inner element (the p element which was changing) and used the clientHeight added with any other constant's and used that as the defined new height. Bit busy, but it works nicely.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.