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

前端 未结 5 1215
无人共我
无人共我 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:09

    What about

    $("#yourdiv").animate({height: 'toggle'});

    Toggle will switch your div on/off, and the animate should make it appear from below. In this scenario, you don't need the specific CSS to "hide" it.

提交回复
热议问题