how fade in a flex box?

后端 未结 4 720
遥遥无期
遥遥无期 2021-01-30 20:15

How do I get a flex box to not be part of the page until I fade it in? I used to do this with \'display: 0;\' and then use jquery .fadeIn(). But now if I set display to 0, when

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 20:57

    Easiest and most clean way (if you can edit DOM) is to wrap the element, and fade the wrapper while having div with flex inside

    css:

    .popup {
      display: none;
    }
    
    .popup__flexbox {
      display: flex;
    }
    

    js:

    $("#popupContainer").fadeIn();
    

提交回复
热议问题