javascript - How to implement variable height animation?
我想大声告诉你
我想大声告诉你 2017-06-26 10:56:12
0
1
845

How to implement an animation with a variable height of p? For example, if a p is display:none, when a button is clicked, it will be displayed, and the height will gradually change from 0 to the maximum height of the p. The answer from Google is to use max-heigth. However, if the max-height setting is unreasonable (either too large or too small), the animation will be unnatural.

我想大声告诉你
我想大声告诉你

reply all(1)
学习ing

The easiest way is to use JQ’s slideUp and slideDown methods.
The following is the demo I wrote in native.
https://jsfiddle.net/11wrgm7b/

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template