当与flex row-reverse

时间:2016-12-06 16:06:20

标签: javascript css3 internet-explorer firefox dom

请看看这个plunker:http://plnkr.co/edit/OXm4T2i0tw6UOEwaDSkx?p=preview

在Chrome中,容器scrollWidth的值为1616px(正确)。在Firefox和IE11中,它是940px(容器的宽度itselft,而不是内容的宽度)。

如果我将容器的弯曲方向设置为row而不是row-reverse,那么一切正常。

这是Firefox和IE中的错误吗?我该如何解决这个问题,或者解决这个问题呢?

感谢。

1 个答案:

答案 0 :(得分:0)

作为解决方法,我在FF和Edge中成功测试了这一点,我首先更改flex-direction属性,读取值然后重置属性。

Updated Plnkr

var container = document.querySelector('.container');
container.style.flexDirection = "row";
var temp = container.scrollWidth;
container.style.flexDirection = "row-reverse";
alert (temp + ' ' + container.scrollWidth);