When flexbox items wrap in column mode, container does not grow its width

后端 未结 6 1964
长情又很酷
长情又很酷 2020-11-21 05:22

I am working on a nested flexbox layout which should work as follows:

The outermost level (ul#main) is a horizontal list that must expand to the right w

6条回答
  •  渐次进展
    2020-11-21 06:06

    Possible JS solution..

    var ul = $("ul.ul-to-fix");
    
    if(ul.find("li").length>{max_possible_rows)){
        if(!ul.hasClass("width-calculated")){
            ul.width(ul.find("li").eq(0).width()*ul.css("columns"));
            ul.addClass("width-calculated");
         }
    }
    

提交回复
热议问题