jQuery .show() a flex box

前端 未结 9 1449
南笙
南笙 2021-02-06 20:56

I have an element with a flexbox

    div#myFlexbox{ display:flex; }

after hide it and show it, it gets messed up.<

9条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-06 21:33

    just use

    .class{display: none}
    
    .class[style*='display: block']{
        display: flex !important;
    }
    

    when jquery add styl attribut css will be applied, works perfectly on Chrome and Mozilla

提交回复
热议问题