在Android +的PhoneGap + jQuery Mobile的水平滚动的图像 [英] Horizontally scrollable image on Android + PhoneGap + jQuery Mobile

查看:144
本文介绍了在Android +的PhoneGap + jQuery Mobile的水平滚动的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序,将可用于Android和iPhone。 该应用程序完成使用jQuery Mobile和编译PhoneGap的。

I'm working on an application that will be available for Android and iPhone. The application is done using jQuery Mobile and compiled with Phonegap.

有时在应用程序的用户能够显示图像,该图像是非常大的,并需要滚动的。 我做了一个JavaScript code,创建一个DIV与论文CSS属性,并追加到身体:

Sometimes in the application a user can display an image, this image is very large, and needs to be scrollable. I've done a javascript code that creates a div with theses css properties and appends it to the body:

position: absolute;
width: 100%;
height: 100%;
z-index: 1200;
background-color: black;
overflow: scroll;

在iPhone它完美的作品,用户可以就他希望在右侧滚动。 在Android上没有,屏幕保持锁定,用户只能下滚。

On iPhone it works perfectly, the user can scroll as far as he wants on the right. On Android it doesn't, the screen stays locked and the user can only scrolldown.

index.html页面上是这样的:

The viewport on the index.html page is like this:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

我已经花大约2个小时玩它,看着在互联网上,但没有发现任何东西,使得屏幕可滚动在Android上。

I've spend about 2 hours playing with it, looking on the internet, but didn't find anything that made the screen to be scrollable on Android.

我不能把它变成另一个页面,用不同的视口,因为我的应用程序是非常深刻javascripted。而且我也无法带回用户在那里,他离开的时候,他想查看的影像的确切地点。

I cannot make it be another page, with a different viewport because my application is very deeply javascripted. And I wouldn't be able to bring back the user to the exact spot where he left when he wanted to view the image.

我运行的想法,并一直在测试这几天。会有人有一个想法,这将有助于我作出滚动弹出在Android?

I'm running out of ideas, and have been testing it for a few days. Would someone have an idea that would help me to make a scrollable popup on android ?

感谢您

推荐答案

要在web视图为Android,你将需要使用模仿原生功能的JavaScript框架创建滚动区域。有几个很好的在那里:

To create scrollable areas in a WebView for Android you will need to use a JavaScript framework that mimics the native functionality. There are several good ones out there:

  • iScroll - http://cubiq.org/iscroll-4 (I like this script)
  • Flexcroll - http://www.hesido.com/web.php?page=customscrollbar
  • jQuery Mobile Scrollview - http://jquerymobile.com/test/experiments/scrollview/

另外请注意,可滚动区域不是真的支持在IOS版本小于5.0(用户必须使用两个手指在旧版本滚动)。

Also, note that scrollable areas are not really supported in iOS versions less than 5.0 (the user has to use two fingers to scroll in older versions).

这篇关于在Android +的PhoneGap + jQuery Mobile的水平滚动的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆