politsin/jquery-ui-touch-punch
Composer 安装命令:
composer require politsin/jquery-ui-touch-punch
包简介
Extension to jQuery UI for mobile touch event support.
README 文档
README
Touch Event Support for jQuery UI
jQuery UI Touch Punch is a small hack that enables the use of touch events on sites using the jQuery UI user interface library.
Visit the official Touch Punch website.
Currently, jQuery UI user interface library does not support the use of touch events in their widgets and interactions. This means that the slick UI you designed and tested in your desktop browser will fail on most, if not all, touch-enabled mobile devices, because jQuery UI listens to mouse events—mouseover, mousemove and mouseout—not touch events—touchstart, touchmove and touchend.
That's where jQuery UI Touch Punch comes in. Touch Punch works by using simulated events to map touch events to their mouse event analogs. Simply include the script on your page and your touch events will be turned into their corresponding mouse events to which jQuery UI will respond as expected.
As I said, Touch Punch is a hack. It duck punches some of jQuery UI's core functionality to handle the mapping of touch events. Touch Punch works with all basic implementations of jQuery UI's interactions and widgets. However, you may find more complex cases where Touch Punch fails. If so, scroll down to learn how you can file and/or fix issues.
This code is dual licensed under the MIT or GPL Version 2 licenses and is therefore free to use, modify and/or distribute, but if you include Touch Punch in other software packages or plugins, please include an attribution to the original software and a link to this Touch Punch website.
Using Touch Punch is as easy as 1, 2…
Just follow these simple steps to enable touch events in your jQuery UI app:
-
Include jQuery and jQuery UI on your page.
<script src="http://code.jquery.com/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script>
-
Include Touch Punch after jQuery UI and before its first use.
Please note that if you are using jQuery UI's components, Touch Punch must be included after jquery.ui.mouse.js, as Touch Punch modifies its behavior.
<script src="jquery.ui.touch-punch.min.js"></script>
-
There is no 3. Just use jQuery UI as expected and watch it work at the touch of a finger.
<script>$('#widget').draggable();</script>
Tested on iPad, iPhone, Android and other touch-enabled mobile devices.
politsin/jquery-ui-touch-punch 适用场景与选型建议
politsin/jquery-ui-touch-punch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.15M 次下载、GitHub Stars 达 6, 最近一次更新时间为 2020 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mobile」 「touch」 「gestures」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 politsin/jquery-ui-touch-punch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 politsin/jquery-ui-touch-punch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 politsin/jquery-ui-touch-punch 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Beyonic PHP Library
Generate Apple Passbooks from your Symfony application
Detects if browser supports mouseover event.
The skeleton application for NativePHP for Mobile.
PHP SDK for Mobile Message SMS API
Extension to jQuery UI for mobile touch event support
统计信息
- 总下载量: 16.15M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 22
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-15