有没有一种标准方法可以使用 WinJS/javascript 在 Metro 应用程序中实现水平滚动效果?
假设我有多个 div动态添加了可变宽度/高度,并且我希望屏幕在溢出时内容更宽时水平滚动,我将如何实现这一目标?
我不希望在滚动包装器上使用具有固定宽度的溢出-x:scroll
<section class="header">
Header which is always shown in top left corner
</section>
<section class="magic-winjs-scroll-container-class">
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
<div style="width:300px;height:200px">Some random div which should stack horizontally</div>
</section>
解决方案:
CSS
.magic-winjs-scroll-container-class {
display: -ms-flexbox;
-ms-flex-direction: row;
-ms-flex-align: center;
}