我的代码位于本文末尾,控制着我的页面<div>
在jQuery Mobile中的<div>
。我有这个div做表滚动,因为它在页面上水平溢出。然而,它表现为在这个截图,:当它被垂直取向发生CSS scroll在移动设备上无法正常显示
这个同样的问题,但这种观点说明它更好。为了更好地说明两个边界,我也侧身滚动了div。我希望div在移动设备上简单地填充页面的整个宽度,因为它可以在大屏幕上正确显示,但如果它溢出,我希望它水平滚动。我已经尝试了overflow: scroll;
和overflow: auto;
,此外还尝试使用代码-webkit-overflow-scrolling: touch;
。我没有尝试过设置宽度的方法,但其他方法均已运行,包括width: 100%;
和position: absolute; left: 0; right: 0;
。
CSS:
@media only screen and (min-width: 1025px){
.ui-page {
width: 960px !important;
margin: 0 auto !important;
position: relative !important;
border-right: 5px #111111 outset !important;
border-left: 5px #111111 outset !important;
border-bottom: none;
}
}
@media only screen and (max-width: 1024px){
.tblscroll {
width: 100%;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
}
简体HTML:
<div data-role="page" id="resultsmain" data-title="Survey Results">
<div data-role="header"><h1>Title</h1></div>
<div data-role="content">text
<div class="tblscroll">
<table>
...table information...
</table>
</div>
</div>
</div>
发布一些代码的页面结构。 – Omar 2013-03-19 15:10:38
@Omar我已经更新了,对不起。 – vaindil 2013-03-19 15:14:24
没关系。在你的情况下,我推荐使用'ui-grid'。检查这个http://jquerymobile.com/demos/1.2.0/docs/content/content-grids.html – Omar 2013-03-19 15:21:23