| 开发者 | studioweb34 |
|---|---|
| 更新时间 | 2026年10月22日 18:02 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
#section link glides
to the right place — whether the visitor clicks it, arrives from another page,
or opens the address with the fragment already in it. The URL updates, the Back
button works, and keyboard focus follows to the section, the way native
navigation does.
Themes that run their own anchor scrolling — Divi among them — no longer fight
you for it. Tabs and accordions built on # links are recognised and left alone.
You decide where it applies
Smooth scrolling is not always welcome everywhere. Turn it off on a single page
from the editor sidebar, or exclude whole sections of the site by path. Keep it
for visitors and native for yourself while you build. Disable it on touch
devices, or below a screen width you set. Hand scrolling back to any panel,
map or modal with a CSS selector.
In short
sw34_easy_scroll_options, _should_run, _config,
_post_types, _settings_saved, _settings_reset), a JavaScript API on
window.SW34EasyScroll with ready and destroyed events, and an optional
window.lenis global for GSAP ScrollTrigger. The data-lenis-prevent
attributes are honoured for the keyboard as well as the wheel.
Lenis is bundled minified and as readable source, released under the MIT licence.
If your theme already registered it, this plugin reuses that copy instead of
loading a second one.
sw34-easy-scroll folder to /wp-content/plugins/.fr_FR) and Spanish (es_ES) catalogues
are bundled — 108 strings, 104 translated in each; the four left untranslated
are the plugin name, the author name and the two URLs, which stay the same in
every language.
Everything visible is translatable, including the strings used by the settings
screen's JavaScript, which are passed through wp_localize_script() rather than
written into the .js file where gettext would never see them.
Credits
Smooth scrolling is powered by Lenis 1.3.26 by
darkroom.engineering, released under the MIT licence. Source repository:
https://github.com/darkroomengineering/lenis — the bundled files are
assets/js/lenis.min.js, its readable source assets/js/lenis.js, and the
stylesheet assets/css/lenis.css. The licence text is in
assets/js/LICENSE-lenis.txt.Add a CSS selector for that element under "Excluded areas". The
data-lenis-prevent attribute is also recognised without any setting.
Yes. Enable "Expose the instance as window.lenis", then drive ScrollTrigger
from the sw34-easy-scroll:ready event.
The plugin never smooths touch scrolling: native mobile scrolling is more responsive and better received, so there is no setting for it. Everything else still applies, and "Disable on touch devices" turns the plugin off entirely on phones and tablets if that is what you want.
Open that page in the editor and tick "Disable smooth scrolling on this page"
in the Smooth scrolling box in the sidebar. For a whole section of the site,
use a wildcard path such as /my-account/* under "Excluded pages" instead.
Yes. Set "Who gets smooth scrolling" to "Everyone except administrators".
Check that "Animate anchor links" is on. When it is, this plugin takes anchor clicks in the capture phase and stops them there, so a theme running its own anchor scrolling — Divi does — cannot overwrite the animation. If you would rather keep your theme's behaviour, turn this setting off.
No. Lenis animates the document, not the boxes inside it. "Let nested areas scroll" only hands the wheel back to that box so the page does not move instead; the box then scrolls natively, without inertia. Animating it would take a second Lenis instance bound to that element.
They should not — form fields are excluded. If it happens on a custom field, add a selector for it under "Excluded areas", and please report it.
SCRIPT_DEBUG is on. No change in behaviour.