jquery mobile 的几个问题,滚动出界,启动屏幕和访问过的链接

发布于 2024-11-09 14:32:55 字数 461 浏览 0 评论 0原文

我已经使用jquery mobile创建了一个移动网站来进入phonegap项目,但我有几个问题,更有经验的用户可能能够为我解决:

----------- 已解决 ---- ---------

  1. 我没有应用任何主题,但是当我单击列表项 Item 时,栏 永远保持蓝色(就像访问过的 永远不会发生的状态)[应该只是 处于活跃和过度状态]

----- 已解决 ------------------

  1. 您可以按住页眉栏或页脚栏并向上或向下滚动进入最能描述的内容(应用程序后面),如何阻止用户滚动出界。

  2. 我有一个启动/加载屏幕,当应用程序启动时,它首先加载得很好,但随后它的大小增加,我看到加载屏幕的一角被放大,最后应用程序进入视图......请建议

谢谢

i have created a mobile site with jquery mobile to go into a phonegap project but i have a couple of questions a more experienced user may be able to resolve for me:

----------- SOLVED -------------

  1. I have applied no theme, but when i click on list items Item, the bar
    stays blue forever ( like a visited
    state that never goes ) [ should just
    have an active and over state ]

----- END SOLVED ------------------

  1. you can hold the header bar or footer bar and scroll beyond up or down into what is best described as ( BEHIND the application ) how can i stop users from scrolling out of bounds.

  2. I have a Splash / Loading screen and this at first loads great when the application starts, but then it increaes in size and i see a blown up corner of the loading screen and then finally the app comes into view.... please advice

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

把人绕傻吧 2024-11-16 14:32:56

我有一个答案 1.

jquery mobile 的 css 代码目前在 alpha 4.1 中已损坏。单击列表项后,该列表项将保持蓝色。除了打开 firebug 或 chrome 开发人员工具并找到该类并将其从 css 文件中删除之外,没有其他办法解决这个问题。

我已经将这个问题通知了他们,我相信其他人也已经通知了他们。所以未来的版本有望纠正它。

I have an answer for 1.

The css code for the jquery mobile is currently broken for alpha 4.1. A click on a list item stays blue after it has been clicked. No way around it aside from opening up firebug, or chromes developer tools and finding the class and removing it from the css file.

I have notified them of this issue, and i believe others have as well. So a future version will correct it hopefully.

策马西风 2024-11-16 14:32:56

至于你的第一个问题......

$('a').live('click',function() {$(this).removeClass( $.mobile.activeBtnClass )});
$('li').live('click',function() {$(this).removeClass( $.mobile.activeBtnClass )});

我注意到在我的网站上,链接(我用 data-role="button" 制作成按钮)和列表项在按下后将保持蓝色。上面的代码将其放在文档的头部后为我解决了这个问题。


----编辑----

对于剩下的两个问题:

一些示例代码和目标设备一样好,但听起来像是一个视口元标记问题。这是我选择的视口

:元名称=“视口”内容=“高度=设备高度,宽度=设备宽度,初始比例= 1.0,最大比例= 1.0”>

此视口将页面调整为设备屏幕的宽度和高度,并且不允许缩放。您可以通过将“maximum-scale=1.0”更改为更大的值来允许缩放(iPhone/Safari 目前最多支持 10.0)。

至于启动画面,Xcode 4.0.2(iPhone 开发)可以轻松地将 Default.png 文件放入 /Resources/splash/ 目录中。如果您使用 Xcode,请确保在创建项目时使用 Phonegap 项目向导,因为 Phonegap 默认情况下会创建这些文件,使您可以轻松替换图像。我使用 Eclipes 进行 Android 开发,这也可以轻松地将启动屏幕添加到您的 Phonegap 应用程序中。只需将以下代码直接放在 /src/App.java 文件中的“onCreate”函数之后和“super.onCreate(savedInstanceState);”之前行:

super.setIntegerProperty("splashscreen", R.drawable.splash);

这需要将名为splash.png的图像(我认为任何文件扩展名都可以)放在/res/drawable-*dpi目录中(通常有hdpi、mdpi和ldpi目录)。

注意:我使用的是 Phonegap 0.9.5.1,但这应该适用于 0.9.2 及更高版本。

----编辑结束----


As for your #1 question...

$('a').live('click',function() {$(this).removeClass( $.mobile.activeBtnClass )});
$('li').live('click',function() {$(this).removeClass( $.mobile.activeBtnClass )});

I noticed on my site that links (that I was making into buttons with data-role="button") and list items would stay blue after pressed. The above code removed this issue for me after placing it in the head of the document.


----EDIT----

For the remaining two questions:

Some example code would be good as well as a target device but it sounds like it's a viewport meta tag issue. Here is the viewport I've settled on:

< meta name="viewport" content="height=device-height,width=device-width,initial-scale=1.0,maximum-scale=1.0" >

This viewport sizes the page to the device-screen width and height and does not allow zooming. You can allow zoom by changing the "maximum-scale=1.0" to a larger value (iPhone/Safari currently supports up-to 10.0).

As for splash screens, Xcode 4.0.2 (iPhone development) made it easy to just put a Default.png file into the /Resources/splash/ directory. If you are using Xcode make sure to use the Phonegap project wizard when you make your project because Phonegap makes these files by default, making it easy for you to replace the images. I use Eclipes for my Android development which is also easy to add a splash screen to your Phonegap app. Simply place the following code in the /src/App.java file directly after the "onCreate" function and before the "super.onCreate(savedInstanceState);" line:

super.setIntegerProperty("splashscreen", R.drawable.splash);

This will require putting an image named splash.png (I think any file extension will work) in the /res/drawable-*dpi directories (there are usually hdpi, mdpi, and ldpi directories).

NOTE: I'm using Phonegap 0.9.5.1 however this should work with anything 0.9.2 and above.

----END EDIT----


~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文