-2
当在像这样呈现dom之后更新元素的顺序属性时,html元素无法重新排序。当由jquery设置时,Css顺序属性不会更新
$(".test").css('order', '0');
这是已知问题吗?
编辑:是的,容器具有下列CSS属性:
display: flex;
flex-direction: column;
overflow-y: overlay;
overflow-x: hidden;
position: relative;
编辑:错误表现在拨弄https://jsfiddle.net/me6g30ur/
我的代码:
$(".update").on("click", function() {
for (var i = 0; i < $(".child").length; i++) {
$(".child").css("order", Math.floor(Math.random * 100));
}
});
你确定它是在柔性包装的CSS?当我测试它时它对我有用 – Neal
您使用的是flexbox吗?这里需要一些背景。 – isherwood
@isherwood是的,检查编辑。 –