【问题标题】:page transition dosn't work using (jquery mobile 1.3.0 and phonegap 2.3)页面转换不起作用(jquery mobile 1.3.0 和 phonegap 2.3)
【发布时间】:2013-03-19 20:26:38
【问题描述】:

页面转换无法使用(jquery mobile 1.3.0 和 phonegap 2.3)我正在使用 jquery mobile 1.3 和 phonegap 2.3 构建应用程序,并且我有类似按钮

    <a href="#page2" data-role="button" data-theme="e" data-transition="slide">Start</a>


我使用 data-transition="slide" 为 android 构建它,但过渡不起作用 我试过了

    .ui-page {-webkit-backface-visibility:hidden}

但它没有工作。

有什么帮助吗?!!!

注意:它在浏览器上运行良好,但在我使用 phonegap 构建它之后,它会转到第二页,但过渡不是“幻灯片”,它只是闪烁然后第二页显示!!

【问题讨论】:

  • #content 是页面 ID 还是 data-role?

标签: android jquery cordova jquery-mobile


【解决方案1】:

我在JSfiddle 中做了一个包含 2 页的示例应用程序,它运行时没有任何问题。你可以自己去看看。

我认为你把Page IDContent ID 搞混了。你在锚标签中给出的标签应该是页面的 ID 而不是内容 div 的 ID。

这是工作示例。

<!-- Start of first page -->
<div data-role="page" id="page1">
    <div data-role="header">
            <h1>Page1</h1>

    </div>
    <!-- /header -->
    <div data-role="content">
        <p>I'm first in the source order so I'm shown as the page.</p> <a href="#page2" data-role="button" data-transition="slide">Page2</a>

    </div>
    <!-- /content -->
    <div data-role="footer">
            <h4>Page Footer</h4>

    </div>
    <!-- /footer -->
</div>
<!-- /page -->
<!-- Start of second page -->
<div data-role="page" id="page2">
    <div data-role="header">
            <h1>Page2</h1>

    </div>
    <!-- /header -->
    <div data-role="content">
        <p>I'm the second in the source order so I'm hidden when the page loads. I'm just shown if a link that references my id is beeing clicked.</p>  <a href="#page1" data-role="button">Back to Page1</a>

    </div>
    <!-- /content -->
    <div data-role="footer">
            <h4>Page Footer</h4>

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

【讨论】:

  • 它在浏览器上运行良好,但在我使用 phonegap 构建它之后它可以运行,但过渡不是“幻灯片”它只是闪烁然后显示页面!!
  • @MohamedElsherbiny 您是否尝试更新到新的 PhoneGap 版本?您是否尝试过使用您正在使用的设备以外的其他设备?通常 HTC 设备最终会出现此类问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-08
  • 1970-01-01
  • 1970-01-01
  • 2012-08-18
  • 2012-02-25
相关资源
最近更新 更多