drupal-package/mousewheel
Composer 安装命令:
composer require drupal-package/mousewheel
包简介
Allows to clone the jquery/jquery-mousewheel repository
README 文档
README
A jQuery plugin that adds cross-browser mouse wheel support with delta normalization.
In order to use the plugin, simply bind the mousewheel event to an element.
It also provides two helper methods called mousewheel and unmousewheel
that act just like other event helper methods in jQuery.
The event object is updated with the normalized deltaX and deltaY properties.
In addition there is a new property on the event object called deltaFactor. Multiply
the deltaFactor by deltaX or deltaY to get the scroll distance that the browser
has reported.
Here is an example of using both the bind and helper method syntax:
// using on $('#my_elem').on('mousewheel', function(event) { console.log(event.deltaX, event.deltaY, event.deltaFactor); }); // using the event helper $('#my_elem').mousewheel(function(event) { console.log(event.deltaX, event.deltaY, event.deltaFactor); });
The old behavior of adding three arguments (delta, deltaX, and deltaY) to the
event handler is now deprecated and will be removed in later releases.
The Deltas...
The combination of browsers, operating systems, and devices offer a huge range of possible delta values. In fact if the user uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or acceleration that is used. This number has the potential to be in the thousands depending on the device. Check out some of the data collected from users here.
Getting the scroll distance
In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
scroll based on the users input. This can be done by multiplying the deltaFactor by the deltaX or deltaY
event property to find the scroll distance the browser reported.
The deltaFactor property was added to the event object in 3.1.5 so that the actual reported delta value can be
extracted. This is a non-standard property.
Building the code in the repo
$ git clone git@github.com:jquery/jquery-mousewheel.git
$ cd jquery-mousewheel/
$ npm install
$ npm run build
$ npm run karma
The unit tests run by karma are very basic sanity checks; improvements welcome. To fully test the plugin, load test/index.html in each supported browser and follow the instructions at the top of the file after the unit tests finish.
drupal-package/mousewheel 适用场景与选型建议
drupal-package/mousewheel 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 566 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「mousewheel」 「drupal-library」 「jquery.mousewheel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 drupal-package/mousewheel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drupal-package/mousewheel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 drupal-package/mousewheel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
An Yii2 jQuery Essential assets component.
A jQuery plugin that adds cross-browser mouse wheel support.
A jQuery plugin that adds cross-browser mouse wheel support with delta normalization.
A jQuery plugin for panning and zooming elements using CSS3.
Allows to clone the highlightjs/highlight.js repository
统计信息
- 总下载量: 566
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-11-26