【问题标题】:Jquerymobile Scrollview comes backs to original position after scrolling.does not holds the scrolled position滚动后 Jquery Mobile Scrollview 返回到原始位置。不保持滚动位置
【发布时间】:2012-03-30 10:55:39
【问题描述】:

我正在使用 jquerymobile 和滚动视图来启用 div 上的水平滚动。但是当我在滚动后抬起手指时,我遇到了问题。它回到原来的位置,无法选择我想选择的项目,因为无法选择滚动的内容。这是我的代码

<div data-scroll="x" style="min-width:10000px; width: auto !important; width: 10000px;border: solid 1px black; white-space: nowrap;">
<div style="width: 350px; float: left;margin-left: 60px;">
             <div data-role="collapsible" data-collapsed="true" data-iconpos="bottom">
                 <h3>Morning</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Afternoon</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Evening</h3>
             </div>
         </div>
         <div style="width: 350px; float: left;margin-left: 60px;">
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Morning</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Afternoon</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Evening</h3>
             </div>

         </div>
         <div style="width: 350px; float: left;margin-left: 60px;">
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Morning</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Afternoon</h3>
             </div>
             <div data-role="collapsible" data-collapsed="true" >
                 <h3>Evening</h3>
             </div>
         </div>


     </div>

因此无法选择第三个内部 div 中的项目,因为它们在滚动时无法到达。我做错了什么。 ?我在滚动视图的演示页面上使用默认的 js 文件。还演示了使用这些 js 文件可以正常工作

【问题讨论】:

    标签: jquery jquery-plugins jquery-mobile scrollview


    【解决方案1】:

    知道这是一个旧线程,它值得任何答案。我今天在使用最新版本的 iscrollview 的 iscroll 4.2 时遇到了同样的问题。使用以下小提琴:http://jsfiddle.net/Gajotres/952NJ/

    索引页

    <div data-role="content">
        <div class="example-wrapper" data-iscroll>
            <ul data-role="listview">
                <li><a href="#">Some link</a></li>
                <li><a href="#">Some link</a></li>  
        </div>          
    </div>
    
    <div data-theme="b" data-role="footer">
        <h1>Footer</h1>
    </div>    
    

    我能够让我的代码正常工作。显然,iscrollview 需要不同的数据角色 div:页面、页眉、页脚和内容才能工作。因此,请确保您的代码放置在这些标签中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-01
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-22
      相关资源
      最近更新 更多