请看看这个plunker:http://plnkr.co/edit/OXm4T2i0tw6UOEwaDSkx?p=preview
在Chrome中,容器scrollWidth
的值为1616px
(正确)。在Firefox和IE11中,它是940px
(容器的宽度itselft,而不是内容的宽度)。
如果我将容器的弯曲方向设置为row
而不是row-reverse
,那么一切正常。
这是Firefox和IE中的错误吗?我该如何解决这个问题,或者解决这个问题呢?
感谢。
答案 0 :(得分:0)
作为解决方法,我在FF和Edge中成功测试了这一点,我首先更改flex-direction
属性,读取值然后重置属性。
var container = document.querySelector('.container');
container.style.flexDirection = "row";
var temp = container.scrollWidth;
container.style.flexDirection = "row-reverse";
alert (temp + ' ' + container.scrollWidth);