jquery-mobile是"mobile first"吗? [英] Is jquery-mobile "mobile first"

查看:78
本文介绍了jquery-mobile是"mobile first"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了Luke WROBLEWSKI撰写的《移动优先》一书,还读过许多其他有关该主题的文章.我是一名Web开发人员,现在我真的很相信移动优先"或渐进式增强"是必经之路.

I have read the book "Mobile first" by Luke WROBLEWSKI and many other readings on that topic. I'm a web developer and now I'm really convinced that "mobile first" or "progressive enhancement" is the way to go.

现在我正在寻找实现这一目标的框架.

Now I'm looking for a framework to achieve this.

jQuery mobile的名字是移动优先",但几天来我已经尝试过,现在我倾向于说不,不是".您不能将其与其他框架混合使用.它的确有技巧,例如将所有页面都保留在DOM中(使用ajax强制加载),这样不会使我的生活变得更轻松.试图使用它来逐步增强功能并通过桌面版本完成而不卸载它,似乎是不可能的.我的意思是您不想在台式机上使用大按钮,所以我想我只需要删除框架的js&css,这听起来很奇怪.我什至不知道是否可能.

JQuery mobile annonce they are "mobile first" but I have given a try during some days and now I would tend to say "No it's not". You can't mix it with other frameworks; it does tricks like keeping all pages in the DOM (forcing the load using ajax) so it doesn't make my life easier. Trying to use it to make progressive enhancement and finish by a desktop version without unload it, seems impossible. I mean you don't want to have big buttons with a desktop computer so I guess I will need to just drop the js&css of the framework and that sounds weird. I don't even know if it's possible.

Jquery mobile看起来像是一个框架,可以实现网站专用的移动Web版本,并具有本机应用程序的外观和感觉,而不是第一个移动网站.

JQuery mobile looks like a framework to achieve a dedicated mobile web version of your site with a look&feel as an native apps more than a mobile first website.

所以请有人告诉我我错了: * jQuery mobile真的是移动优先"吗? *我可以使用jquery mobile进行渐进增强(使用桌面作为最后一个目标)吗?如果是,请告诉我怎么做.

So please could someone tell me where I'm wrong: * is jQuery mobile really "mobile first"? * could I do progressive enhancement (with desktop as last target) with jquery mobile ? in case of yes, please tell me how.

以下是相应的页面,告诉您jquerymobile首先是移动设备: http://view.jquerymobile.com/1.3.0/docs/intro/#ProgressiveEnhancement

Here is the corresponding page telling that jquerymobile is mobile first: http://view.jquerymobile.com/1.3.0/docs/intro/#ProgressiveEnhancement

我也尝试过zurb的基础,它运作良好,但是没有提供足够的小部件或工具来提供漂亮的mobiel UI.混合两者都是很好的方法,但是它需要大量的工作(CSS冲突+可能是JS冲突),我什至不知道是否可能.

I have also try zurb's foundation and it works well but do not provide enough widget or tools to provide nice mobiel UI. Mix both would be the great point but it will need a lot of works (CSS conflict + may be JS conflict) and I don't even know if it's possible.

任何有关如何在移动优先环境中使用jquery mobile的建议都将受到欢迎!

Any advices on how do you use jquery mobile in a mobile first context will be welcomed !

推荐答案

基本思想

让我们从头开始,让每个人都理解,移动优先的定义是:

移动优先"是一种想法,即网站应首先设计用于 移动设备,仅包括网站访问者的那些任务/项目 使用最多.然后随着屏幕空间的增加,添加任务/功能 根据用户优先级进行设置.

Mobile First is the idea that web sites should first be designed for mobile devices, including only those tasks/items that website visitors use most. Then as screen real estate increases, add in tasks/features as needed based on user priority.

引述摘自 此处 .

根据我的经验,没有任何现有框架可以完全归类为移动优先. jQuery Mobile已关闭但还不够.

From my experience there isn't any existing framework that can be fully categorized under mobile first. jQuery Mobile is closed but not enough.

首先,我可以同意您的说法,即jQuery Mobile不能与其他框架一起使用. jQM是一个高度可定制的框架,并且可以完全定制为几乎其他可用的框架.

First, I can agree with your statement that jQuery Mobile can't be used with other frameworks. jQM is a heavily customizable framework and it can be, to full extent, customizable to almost very other available framework.

如果要使用主干或敲除,可以根据其MVP或MVC架构对其进行自定义.如果您想将其与类似的框架一起使用,则只需使用jQM 功能 你要.您只需要对它进行搜索即可.

If you want to use backbone or knockout that it can be customized to their MVP or MVC architecture. If you want to use it with similar framework they use only jQM functionality you want. You only need to Google it.

但是,我会不断重复,目前,jQM并不是用于桌面开发的好的即用型"平台.这是事实.尽管它确实提供了适合桌面浏览器的小部件,但它们看起来仍然像是超大尺寸的移动小部件.

But, and I will repeat it constantly, currently jQM is not a good "out of box" platform for desktop development. This is simply the fact. While it do provide widgets adapted to desktop browsers they still look like over sized mobile widgets.

第二大缺点是它们的官方文档.尽管在某些细分市场中进行了详尽的介绍,但其中存在大量错误,但尚无示例,缺少API描述. IT部门似乎向您解释了什么是汽车,却忘记了如何正确驾驶它.

Second big disadvantages is their official documentation. While heavily detailed in some segments it has a ton of errors, non existing examples, lacking API descriptions. IT looks like someone explained you what car is but forgot to mention how to drive it correctly.

可以修复此问题,不幸的是,只有进行大量的自定义.而且根据定义,这不是移动优先框架.但是,为使我的观点更加准确,这是在移动/桌面环境中使用jQM的一个很好的例子: .尊重开发人员,他们在将移动设备与桌面设备合并方面做得非常出色.不幸的是,这只是平庸海洋中的一滴美丽.

This can be fixed, unfortunately only with a heavy customization. And by the definition this is not a mobile first framework. But to make my point more precise here's a good example of jQM usage in mobile/desktop environment: Mobile Songmeanings. Respect to that developers, they did a beautiful job of merging mobile with desktop. Unfortunately this is but a beautiful drop in a ocean of mediocrity.

此问题最常见的解决方法是将jQM用于移动设备,将jQ UI用于桌面环境.我们还应在此混合中添加 Modernizer ,因为我们需要它:

Most common fix to this problem is usage of jQM for mobile devices and jQ UI for desktop environment. We should also add a Modernizer into this mix cause we need it to:

  • 将移动环境与桌面环境分开
  • 根据检测到的环境创建动态内容加载器(js和css)

如果您想方便地使用开箱即用解决方案,那么我不建议您使用 jQuery Mobile .花费数月的学习,开发和测试的成败,以及好的和坏的方面,如何将其与其他框架一起使用以及完全理解它.

If you want easy out of box solution then I don't advise jQuery Mobile usage. It takes few months of hit and miss learning, development and testing, good and bad sides, how to use it with other frameworks and such to fully understand it.

这篇关于jquery-mobile是"mobile first"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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