用于移动和桌面的 jQuery Mobile? [英] jQuery Mobile for mobile and desktop?

查看:19
本文介绍了用于移动和桌面的 jQuery Mobile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网络应用.MySql/PHP 后端,HTML/jQuery 前端.

I'm developing a web app. MySql/PHP back-end, and HTML/jQuery front-end.

我想使用 jQuery UI 框架.

I wanted to use jQuery UI framework.

现在看到 jQuery Mobile 已经过时了,我想让移动设备尽可能多地访问该应用程序.

Now is see that jQuery Mobile is out, and I want to make the app accessible to mobile devices as much as possible.

我用谷歌搜索,但没有找到高质量的答案.

I Googled, but didn't find a quality answer.

如果我使用 jQuery Mobile,我可以使用相同的代码来完成所有工作吗?

Can I make it all to work form the same code if I use jQuery Mobile?

如果通过移动浏览器访问,我希望它显示移动小部件.
但是使用 jQuery UI 小部件是从桌面浏览器访问的.

I'd like it to show mobile widgets if accessed form mobile browser.
But use jQuery UI widgets is accessed from desktop browser.

仅使用 jQuery Mobile 及其标记就可以实现,还是我必须分别编写移动端 (jQuery Mobile) 和桌面端 (jQuery UI)?

Is that possible just by using jQuery Mobile and its markup, or I have to write the front-end for mobile (jQuery Mobile) and desktop (jQuery UI) separately?

也就是说,如果从桌面浏览器访问,jQuery Mobile 是否可以自动回退"到 jQuery UI.

That is, can jQuery Mobile, automatically "fall-back" to jQuery UI if accessed from desktop browser.

推荐答案

我认为这在很大程度上取决于您想要做什么以及您试图捕捉的功能.如果您希望网页在移动设备和同一桌面上以某种方式运行,那么通过一些仔细的编码/测试,您将可以使用 jquery.mobile.

I think it largely depends on what you want to do and functionality you're trying to capture. If you want a webpage to behave a certain way on mobile and the same desktop, then with some careful coding/testing, you'll be alright with jquery.mobile.

如果您查看 jquery.mobile(未压缩版本)的 CSS,您实际上可以直接编辑代码,以针对特定屏幕尺寸以您希望的方式显示 HTML 元素.只需选择桌面/大屏幕尺寸之一即可适当缩放.

If you check out the CSS for jquery.mobile (uncompressed version), you can actually edit the code directly to show the HTML elements the way you want to for particular screen sizes. Just select the one for desktop / large screen sizes to scale appropriately.

根据您在移动版本方面要实现的目标,我还会查看 jQTouch - 它允许移动- 特定功能,例如点击"(代替点击"),例如 - 但也有一个桌面兼容性选项,因此它可以恢复为桌面浏览器.

Depending on what you're trying to accomplish in terms of your mobile version, I'd also check out jQTouch - which allows for mobile-specific functionality, such as "tap" (in place of "click"), as an example - but also has a desktopCompatability option, so it reverts for desktop browsers.

请注意,使用这些库中的任何一个,您仍然需要根 jquery 库.

One note, with either of these libraries, you'll still need the root jquery library.

希望这会有所帮助.

这篇关于用于移动和桌面的 jQuery Mobile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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