简体   繁体   English

在jquery移动页面中添加面板会使页面滚动在卡住的设备上

[英]Adding panels in jquery mobile page makes page scrolling on device stuck

I am new to Jquery Mobile and Phonegap. 我是Jquery Mobile和Phonegap的新手。 I have created an app with multiple pages within one HTML page as mentioned by the Jquery Mobile site for developing apps in mobile. 正如Jquery Mobile网站提到的,我已经在一个HTML页面中创建了一个包含多个页面的应用程序,用于在移动设备中开发应用程序。

I have also added panels for each pages. 我还为每个页面添加了面板。 My problem is, after adding the panel, the scrolling up/down of the whole page becomes stuck. 我的问题是,添加面板后,整个页面的上/下滚动变得卡住了。 As in, you have to drag twice to scroll the page. 与之相同,您必须拖动两次才能滚动页面。 This occurs when you run the app on iPhone/iPad and no problem on browser. 当您在iPhone / iPad上运行应用程序而在浏览器上没有问题时,会发生这种情况。 This issue does not exist when the panel is removed from the page. 从页面上删除面板时不存在此问题。

I have included the panel as a sibling of Header, Content and Footer, and also the panel is working fine. 我已将该面板作为页眉,内容和页脚的同级对象,并且该面板工作正常。

What could be the reason? 可能是什么原因? This is the panel html 这是面板html

<div data-role="panel" id="menuPanel3" data-position="right" data-display="push" data-theme="a">
<div data-role="controlgroup" data-corners="false">
<a href='javascript:void(0)' data-corners="false" data-role=button onclick="nav('#wallet')" data-theme="a">Wallet</a>
<a href='javascript:void(0)' data-corners="false" data-role=button data-theme="a">Settings</a>
<a href='javascript:void(0)' data-corners="false" data-role=button data-theme="a">About Us</a>
<a href='javascript:void(0)' data-corners="false" data-role=button onclick=logout() data-theme="a">Logout</a>
</div> 
</div><!-- /panel -->

When i remove the above block from the page block, scrolling becomes fine. 当我从页面块中删除上述块时,滚动变得很好。

Following are the styles applied.. 以下是所应用的样式。

<style>
    /*this block should go in the styles.css file*/
    .ui-panel-inner {
        padding:0px; /*make the buttons flush edge to edge*/
    }
    .ui-controlgroup {
        margin:0; /*make the buttons flush to the top*/
    }
    #header {
        height:54px;
    }
    #bars-button {
        margin:7px;
    }
</style>

Please help... 请帮忙...

A panel must be a sibling to the header, content and footer elements inside a jQuery Mobile page. 面板必须是jQuery Mobile页面内的header,content和footer元素的同级对象。 You can add the panel markup either before or after these elements, but not in between. 您可以在这些元素之前或之后添加面板标记,但不能在两者之间添加。 A panel cannot be placed outside a page, but this constraint will be removed in a future version. 面板不能放置在页面外部,但是此约束将在以后的版本中删除。

Here is an example of the panel before the header, content and footer in the source order: 这是源顺序中的页眉,内容和页脚之前的面板示例:

<div data-role="page">          

    <div data-role="panel" id="mypanel">
        <!-- panel content goes here -->
    </div><!-- /panel -->

    <!-- header -->
    <!-- content -->
    <!-- footer -->

</div><!-- page -->

Follow these instructions EXACTLY and all will be fine: http://jquerymobile.com/demos/1.3.0-beta.1/docs/panels/# 完全按照这些说明进行操作,就可以了: http : //jquerymobile.com/demos/1.3.0-beta.1/docs/panels/#

I used panel recently had no trouble whatsoever: http://radio.idev.ge 我使用的面板最近没有任何问题: http : //radio.idev.ge

The problem was solved by adding 'data-position-fixed="true"' to the panels. 通过向面板添加'data-position-fixed =“ true”'解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM