简体   繁体   English

适用于DIY移动UI层的jQuery vs. jQuery Mobile?

[英]jQuery vs. jQuery Mobile for DIY mobile UI layer?

I'm about to start building UI widgets for our mobile web site. 我将开始为我们的移动网站构建UI小部件。 The main factors are: 主要因素有:

  • they are relatively unique interactions, so it doesn't seem practical to start with an off-the-shelf widget library (jQuery UI, for isntance) 它们是相对独特的交互,因此从现成的窗口小部件库(jQuery UI,表示不便)开始似乎并不实际。
  • we need to support a wide range of browsers/mobile OSes 我们需要支持各种浏览器/移动操作系统

The team seems happy to go down the jQuery path, which I am happy about. 团队似乎很高兴沿着jQuery之路走,对此我感到高兴。 The next question is which flavor? 下一个问题是哪种味道? What do I need to consider to decide if we should go with a minimum jQuery library or to go with jQuery Mobile. 我需要考虑什么决定我们应该使用最小的jQuery库还是使用jQuery Mobile。

Perhaps a better way to ask the question: aside from the pre-built UI components in jQuery Mobile, are there advantages to using jQuery mobile over jQuery in the mobile space? 也许可以问一个更好的方法:除了jQuery Mobile中的预构建UI组件之外,在移动领域中使用jQuery mobile优于jQuery吗?

UPDATE: 更新:

I think I have a better way to ask this question. 我想我有一个更好的方法来问这个问题。 I'd like to use the 'stripped down' version of jQuery but have the touch-events of jQuery Mobile (but don't need the whole jQuery Mobile UI layer). 我想使用jQuery的“精简版”版本,但具有jQuery Mobile的触摸事件(但不需要整个jQuery Mobile UI层)。 Based on that, what's the approach I should be taking? 基于此,我应该采取什么方法?

I like having the touch-centric events of jQuery Mobile, but won't be using any of the default UI elements/framework. 我喜欢jQuery Mobile的以触摸为中心的事件,但不会使用任何默认的UI元素/框架。 I like the fact that one can use jQuery sans any UI elements, but it doesn't have the touch events (or does it?) 我喜欢这样一个事实,即可以使用jQuery且没有任何UI元素,但是它没有触摸事件(或者是没有?)

If you don't use the built-in UI components, the biggest things that you gain in jQuery Mobile are the new events. 如果您不使用内置的UI组件,那么在jQuery Mobile中获得的最大好处就是新事件。 There are events for things like gestures, taps, and orientation changes. 有些事件涉及手势,轻击和方向更改。

See: http://jquerymobile.com/demos/1.0a4.1/docs/api/events.html 请参阅: http : //jquerymobile.com/demos/1.0a4.1/docs/api/events.html

You also gain a ton of built-in CSS classes that define things like screen size, platform, and orientation. 您还将获得大量的内置CSS类,这些类定义诸如屏幕大小,平台和方向之类的内容。

I do recommend that you at least look at the pre-built components (especially for menus) as they are good looking and drastically decrease development time. 我确实建议您至少查看预构建的组件(尤其是菜单组件),因为它们外观美观并且可以大大减少开发时间。 There is also a CSS stylesheet (which admittedly seems weird if you are used to non-mobile jQuery) which helps format your page for mobile devices. 还有一个CSS样式表(如果您习惯于非移动jQuery,这显然很奇怪),它可以帮助您格式化移动设备页面。 If you don't use the pre-built components you are really missing out on a lot of jQuery Mobile. 如果您不使用预构建的组件,那么很多jQuery Mobile确实会缺少这些组件。

Keep in mind that jQuery Mobile is in Alpha so there will be bugs. 请记住,jQuery Mobile在Alpha中,因此会出现错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM