【问题标题】:make long pages scroll in hybrid app (phonegap + jquery mobile)在混合应用程序中滚动长页面(phonegap + jquery mobile)
【发布时间】:2014-06-12 21:23:31
【问题描述】:

我有一个 JQM 1.4 + Phonegap 3.3 应用程序,其中有一个长文本页面。我希望它是可滚动的。但触摸滚动在 Android 2.3 中不起作用。

如何解决这个问题?

谢谢

【问题讨论】:

  • 好的@Omar iscroll + JQM 1.4的最佳实践是什么(我应该赞成这个:github.com/watusi/jquery-mobile-iscrollview)?
  • 这个在jQM中被广泛使用,试试吧。
  • @Omar,我刚做了第一次尝试,它似乎工作正常,但我想保留在桌面上使用我的应用程序的选项,而不是在右边有这个双滚动iscroll 涉及,所以我有这个 isPhonegap 函数,我试过这个:$(document).on('pagebeforecreate', '#welcome-page', function(){ //make it scrollable on android if ( isPhoneGap() ) { $("#contentFaq").attr("data-iscroll"); } }); 但它似乎没有成功....页面不滚动。我猜我的页面事件不是正确的,你能指出我正确的路径吗?
  • 我想你可以随时初始化插件。编辑:试试.iscrollview("disable or enable")
  • @Omar 和 $("#contentFaq").iscrollview("enable"); 我得到一个 Error: cannot call methods on iscrollview prior to initialization; attempted to call method 'enable'

标签: jquery-mobile cordova


【解决方案1】:

CSS 溢出滚动在 android 2.x 上不起作用,所以你必须自己做。这里有一些解决方案:

  1. 使用 javascript 插件,例如 iScrolltouchScroll

  2. 制作滚动按钮。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-29
    • 1970-01-01
    • 1970-01-01
    • 2016-01-09
    • 1970-01-01
    相关资源
    最近更新 更多