scrolljacking
它能做什么
这个技能检查网站是否改变了原生滚动,例如滚动速度、方向或逐页跳转,并去掉这些改动。它面向希望滚动感觉自然、人人都舒适的前端开发者。
适用场景
- ✓你请智能体检查网站是否改变了滚动方式的时候。
- ✓访客反映滚动感觉卡顿、跳动或难以控制的时候。
- ✓你在添加自定义滚动效果,并希望它们不会干扰导航的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/scrolljacking/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“访客说我网站上的滚动感觉很奇怪,而且会跳动。请帮我去掉所有改变滚动方式的代码吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会查找覆盖滚动速度、方向或在滚动时触发导航的 JavaScript。它会移除或调整这些代码,并保留必要的自定义效果,同时提供关闭该效果的方式。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid scrolljacking and custom scroll behavior
Scrolljacking breaks user expectations, interferes with assistive technologies, and creates unpredictable experiences that frustrate users with motor impairments or cognitive disabilities.
Quick Reference
- Never override native scroll speed or direction
- Avoid scroll-triggered navigation (one page per scroll)
- Scrolljacking breaks assistive technologies and user expectations
- If custom scrolling is essential, provide a way to disable it
Check
Test scrolling behavior and verify it feels native. Check that scroll speed is not modified, scroll direction is not inverted, and scroll events are not hijacked for animations or navigation without user consent.
Fix
Remove JavaScript that overrides default scroll behavior. If custom scrolling is essential, respect prefers-reduced-motion and provide a way to disable custom scroll effects.
Explain
Explain how scrolljacking disrupts expected navigation patterns, interferes with assistive technologies, and creates unpredictable experiences for users with motor impairments or cognitive disabilities.
Code Review
Review the rendered markup and interactive states that affect Avoid scrolljacking and custom scroll behavior. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/scrolljacking
常见问题
什么是 scrolljacking?
这是指网站改变了正常的滚动行为,使滚动操作无法按访客预期移动页面。
谁会受到影响?
这个技能说,它可能让有运动障碍或认知障碍的用户感到沮丧,并干扰辅助技术。
如果确实需要自定义滚动效果怎么办?
这个技能说,应尊重减少动效设置,并提供关闭该效果的方式。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid scrolljacking and custom scroll behavior. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #3010
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。