Slide down animation from display:none to display:block?

前端 未结 5 1221
无人共我
无人共我 2020-12-14 07:47

Is there a way to animate display:none to display:block using CSS so that the hidden div slides down instead of abruptly appearing, or should I go about this a different way

5条回答
  •  死守一世寂寞
    2020-12-14 08:24

    Since you're already using jQuery, the simplest thing is just to use slideDown(). http://api.jquery.com/slidedown/

    There's also slideToggle().

    Then you don't need to manually do all the browser-specific transition css.

提交回复
热议问题