【问题标题】:horizontal table slider in jquery mobile uijquery mobile ui中的水平表滑块
【发布时间】:2014-08-01 13:47:36
【问题描述】:

iam 正在开发 jquery mobile ui...iam 卡住了,因为表格在移动设备中不能水平滑动,所以 iam 只能在移动设备中看到几列(比如 10 列中的 3 列)...。谁能帮帮我??

谢谢你...

这是代码:

    </div>`<div data-role="content" style="overflow:auto;">
            <table data-role="table"  data-mode="columntoggle" class="ui-responsive ui-shadow" id="myTable" style="overflow:auto;">
  <thead>
    <tr>
      <th data-priority="6">CustomerID</th>
      <th>CustomerName</th>
      <th data-priority="1">ContactName</th>
      <th data-priority="2">Address</th>
      <th data-priority="3">City</th>
      <th data-priority="4">PostalCode</th>
      <th data-priority="5">Country</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>Alfreds Futterkiste</td>
      <td>Maria Anders</td>
      <td>Obere Str. 57</td>
      <td>Berlin</td>
      <td>12209</td>
      <td>Germany</td>
    </tr>
    <tr>
      <td>2</td>
      <td>Antonio Moreno Taqueria</td>
      <td>Antonio Moreno</td>
      <td>Mataderos 2312</td>
      <td>Mexico D.F.</td>
      <td>05023</td>
      <td>Mexico</td>
    </tr>
    <tr>
      <td>3</td>
      <td>Around the Horn</td>
      <td>Thomas Hardy</td>
      <td>120 Hanover Sq.</td>
      <td>London</td>
      <td>WA1 1DP</td>
      <td>UK</td>
    </tr>
    <tr>
      <td>4</td>
      <td>Berglunds snabbkop</td>
      <td>Christina Berglund</td>
      <td>Berguvsvag</td>
      <td>Lulea</td>
      <td>S-958 22</td>
      <td>Sweden</td>
    </tr>

  </tbody>
</table>`

【问题讨论】:

    标签: jquery jquery-mobile jquery-plugins


    【解决方案1】:

    尝试将容器 div CSS 更改为:

    .tableCont {
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
    }
    

    overflow 应该是滚动而不是 auto,并且 -webkit-overflow-scrolling 允许移动 webkit 滚动单个 dom 元素。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多