适用于移动设备和台式机的jQuery Mobile? [英] jQuery Mobile for mobile and desktop?

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

问题描述

我正在开发一个Web应用程序. 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.

我用Google搜索,但找不到高质量的答案.

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 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 -该版本可用于移动设备特定的功能,例如"tap"(代替"click"),但也具有desktopCompatability选项,因此它会针对桌面浏览器进行还原.

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.

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

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

希望这会有所帮助.

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

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