简体   繁体   English

跨浏览器库,降低触摸事件,没有额外的重量

[英]Library of cross-browser, degrading touch events, without the extra weight

I am building a single-page web application and I've been looking for a library that implements just a set of touch events, tap, taphold, swipe etc but doesn't: 我正在构建一个单页的Web应用程序,我一直在寻找一个实现一组触摸事件,点击,敲击,滑动等的库,但不是:

  • a) force me to use Sencha Touch a)强迫我使用Sencha Touch
  • b) come with tons of extra stuff that I don't want, without the ability to rip out just the events portion (Jquery mobile & Sencha Touch) b)带来了大量我不想要的额外东西,而没有能够撕掉事件部分(Jquery mobile&Sencha Touch)

I did try to rip out just the events stuff from jquery mobile and the swipe events stopped working, not sure why. 我确实试图从jquery mobile中删除事件,滑动事件停止工作,不知道为什么。

My experiments with jquery mobile have frustrated me, it forces me to build my app "their" way, having to add data-role="page" to my container just to stop the page being blank when it's included, adding loading divs to the body (yuk). 我使用jquery mobile的实验让我感到沮丧,它迫使我以“他们的”方式构建我的应用程序,不得不将data-role =“page”添加到我的容器中,以便在包含它时将页面保持为空白,将加载div添加到身体(yuk)。 Since I already have a working app I don't want that. 由于我已经有一个工作的应用程序,我不希望这样。

Does anyone have any recommendations? 有没有人有任何建议?

Cheers 干杯

jQM is now decoupled: jQM现在解耦了:

Widgets: Now decoupled for flexible builds 小部件:现在解耦为灵活的构建

We've wanted to decouple all our widgets from the page plugin for a long time now and we're happy to announce that we finally landed this change. 我们想要将所有小部件与页面插件分离很长一段时间,我们很高兴地宣布我们终于实现了这一改变。 So what exactly does decoupled mean anyway? 那究竟什么解耦意味着呢? Well, the individual widgets and utilities have always been broken out into separate script files. 好吧,各个小部件和实用程序一直被分解为单独的脚本文件。 However, the page plugin was responsible for handling the auto-initialization all of the official plugins found in the markup at page creation. 但是,页面插件负责处理自动初始化在页面创建时标记中找到的所有官方插件。 This situation made it impossible to remove plugins you don't need without causing errors, and generally set a bad precedent for future widget additions. 这种情况使得无法在不造成错误的情况下删除不需要的插件,并且通常会为将来添加的小部件设置一个不好的先例。

Now, pretty much all the UI widgets in the jQuery Mobile library are completely decoupled so they can simply be deleted if not needed for a particular project. 现在,几乎所有jQuery Mobile库中的UI小部件都完全解耦,因此如果不需要特定项目,可以简单地删除它们。 This change allows you to dramatically reduce the size of the library by only including the specific set of widgets or features you need, in addition to the handful of required, core files. 此更改允许您通过仅包含所需的特定小部件或功能集以及少数所需的核心文件来显着减小库的大小。 While we still plan to do more decoupling and cleanup, the following files are now decoupled and can safely be removed from the make file before you do a custom build: 虽然我们仍计划进行更多的解耦和清理,但现在可以解除以下文件的分离,并且可以在执行自定义构建之前安全地从make文件中删除:

  • page header/content/footer 页眉/内容/页脚
  • collapsible 可折叠
  • controlgroup 控制组
  • fieldcontain fieldcontain
  • fixheaderfooter fixheaderfooter
  • button 按键
  • checkboxradio checkboxradio
  • select 选择
  • slider 滑块
  • textinput 的TextInput
  • links theming 链接主题
  • listview 列表显示
  • navbar 导航栏
  • grid

We will work on a dependency map because a few widgets rely on others to work. 我们将在依赖关系图上工作,因为一些小部件依赖于其他工作。 For example, the button markup plugin is called by many of the widgets above, so it can only be excluded but if you're not using any of the widgets that depend on buttons. 例如,按钮标记插件由上面的许多小部件调用,因此只能排除它,但如果您没有使用依赖于按钮的任何小部件。

We're still working out our recommendations for mapping plugin dependencies and decoupling things even further. 我们仍在制定有关映射插件依赖关系和进一步解耦的建议。 Ultimately, this will be surfaced in a download builder tool, so stay tuned! 最终,这将在下载构建工具中浮出水面,敬请关注!

You can head over to their GIT Repo and just download what you want: 您可以访问他们的GIT Repo并下载您想要的内容:

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

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