felixarntz/fast-smooth-scroll
Composer 安装命令:
composer require felixarntz/fast-smooth-scroll
包简介
This lightweight plugin enhances user experience by enabling smooth scrolling for anchor links without the need for jQuery or other dependencies.
关键字:
README 文档
README
Fast Smooth Scroll
This lightweight plugin enhances user experience by enabling smooth scrolling for anchor links without the need for jQuery or other dependencies.
This plugin takes a no-frills approach to smooth scrolling, providing a fast, performant, and accessible user experience.
Simply enable the plugin, and any anchor links (i.e. links that point to other content on the same page) will provide a smooth scrolling experience rather than abruptly jumping to the destination content.
The plugin relies on the latest smooth scrolling techniques using CSS. A very fast and lightweight JavaScript polyfill (<1KB) is included to equally support older browsers, including Internet Explorer. So you can rest assured this plugin covers your userbase.
Why does this plugin exist?
Smooth scrolling is a basic feature to enhance user experience, so it shouldn't come at a performance cost that at the same time harms user experience elsewhere.
Several other smooth scrolling solutions unfortunately rely on outdated techniques such as jQuery, which can hurt your site's performance, and is really not necessary to provide the feature. Even browsers as old as 10 years don't need jQuery to achieve smooth scrolling. In fact, as of today you can achieve the behavior with only CSS, not even requiring any JavaScript.
Another potential reason to use this plugin over other smooth scrolling solutions is accessibility: This plugin respects the user preferences around reduced motion, which can avoid discomfort for those with vestibular motion disorders.
You may already use a smooth scrolling plugin, but it is worth double checking that it doesn't use one of those outdated, inefficient, and inaccessible approaches that may slow down your site or affect user interactions negatively.
More technical details
This plugin simply enables smooth scrolling with the scroll-behavior CSS property. This property has been supported by all modern browsers for a few years now.
To support older browsers as well, a lightweight JavaScript polyfill is included, which is only loaded for browsers that lack support for the CSS property and doesn't require any dependencies. The polyfill uses latest JavaScript user experience best practices such as requestAnimationFrame to provide a smooth scrolling experience without potentially blocking other user interactions.
For relevant browser support, see:
- CSS Scroll-behavior
- CSS property: scroll-padding-top
- prefers-reduced-motion media query
- requestAnimationFrame
- High Resolution Time API
- NodeList API
- Window API: scrollTo
Installation and usage
You can download the latest version from the WordPress plugin repository.
Please see the plugin repository installation instructions for detailed information on installation and the plugin repository FAQ for additional details on usage and customization.
Alternatively, if you use Composer to manage your WordPress site, you can also install the plugin from Packagist:
composer require felixarntz/fast-smooth-scroll:^1.0
Contributions
If you have ideas to improve the plugin or to solve a bug, feel free to raise an issue or submit a pull request right here on GitHub. Please refer to the contributing guidelines to learn more and get started.
You can also contribute to the plugin by translating it. Simply visit translate.wordpress.org to get started.
felixarntz/fast-smooth-scroll 适用场景与选型建议
felixarntz/fast-smooth-scroll 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 46 次下载、GitHub Stars 达 7, 最近一次更新时间为 2023 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「performance」 「plugin」 「wordpress」 「lightweight」 「user experience」 「Smooth Scroll」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 felixarntz/fast-smooth-scroll 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 felixarntz/fast-smooth-scroll 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 felixarntz/fast-smooth-scroll 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
g4 application profiler package
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
WordPress mu-plugin to remove jQuery Migrate from the list of jQuery dependencies and to allow jQuery to enqueue before </body> instead of in the <head>.
Create link to static resources with cache-breaking segment based on md5 of the file
Production-ready Laravel Prometheus metrics package with built-in collectors for HTTP, database, cache, queue, events, errors, filesystem, and mail monitoring
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-11-05