YL

SCROLL EFFECT

粘性滚动叙事Sticky Scroll Storytelling

一侧画面钉在屏幕上不动,另一侧文字随滚动逐段推进,讲一个三幕式的故事。

中英对照

中文
粘性滚动叙事
英文
Sticky Scroll Storytelling
别名
粘性分步叙事、Scrollytelling、钉住式叙事
一句话
一侧画面钉在屏幕上不动,另一侧文字随滚动逐段推进,讲一个三幕式的故事。

效果预览

① 连接数据源
两分钟接入你的工具栈
② 自动清洗归一
脏数据自动变成标准格式
③ 生成洞察报告
每天早上八点准时送达
画面钉在这里
右栏 sticky · 左栏滚动推进

常见变体

全屏背景叙事Full-bleed Sticky Background

画面铺满整个视口当背景,文字步骤是叠在上面的卡片,一张张滑过,常见于新闻专题和数据报道。

适合用在哪

产品工作原理讲解、里程碑回顾、数据报告页。

不适合:步骤之间没有共同画面的内容(几个互不相关的功能点):右栏每一步都整个换掉,钉住就失去意义,用左右交错布局更直接;需要用户反复对照的教程(安装指南、操作手册)也不合适,一次只亮一帧画面,想回看上一步只能往回滚,编号列表配静态截图更方便查阅。

和相近模式的区别

粘性叠层卡片Sticky Stacking Cards

叠层卡片没有单独的画面栏,每张卡自己就是一段完整内容,后一张从下方滑上来盖住前一张,适合并列的几个主题;粘性滚动叙事是一侧画面钉住不动、另一侧文字逐段推进,几段文字讲的是同一个画面的变化(比如同一个产品界面的三个状态),重点是前后连贯。要讲清先后顺序和因果时用叙事,只是逐条展示亮点时用叠卡。

容易踩的坑

  • 父级设置了 overflow:hidden,position:sticky 直接失效,右栏画面跟着滚走。
  • 移动端仍保持左右两栏,屏幕过窄时文字和画面都被挤得无法阅读,应改为上下堆叠。
  • 步骤超过 5 段且每段 80vh,用户滚动很久都看不到结尾,中途流失。

设计提示词 · Prompt

粘性滚动叙事(Sticky Scroll Storytelling):外层 CSS Grid 两栏;左栏文字流正常滚动,每个步骤是一个 80vh 高的段落;右栏 position:sticky; top:15vh; height:70vh; align-self:start 钉住一帧视觉画面(Grid 子项默认被拉伸,不写高度和 align-self:start 会钉不住)。用 IntersectionObserver 监听左侧各步骤进入视口中线,切换右栏画面的内容(交叉淡入淡出)并高亮当前步骤。文字步骤最多 3-5 段,每段一句话大标题 + 两行说明。这个故事结构是"画面不动、文字走",和轮播的根本区别是用户掌控节奏。
Sticky Scroll Storytelling: outer CSS Grid with two columns; the left column's text flows and scrolls normally, with each step being an 80vh-tall section; the right column pins one visual frame with position:sticky; top:15vh; height:70vh; align-self:start (grid items stretch by default; without a height and align-self:start the column will not stick). Use IntersectionObserver to detect each left-side step crossing the viewport midline, switch the right-column visual content (crossfade) and highlight the current step. At most 3-5 text steps, each with a one-sentence large headline + two lines of description. This story structure is "the visual stays, the text moves"; the fundamental difference from a carousel is that the user controls the pace.

可复制 CSS

自包含的最小实现,粘贴到空白页面即可生效;类名可以按项目规范改名。

/* <section class="story">
     <div class="story__steps">
       <div class="story__step is-active" data-step="0"><h3>连接数据源</h3><p>…</p></div>(3-5 段)
     </div>
     <div class="story__stage">
       <figure class="story__frame is-active" data-step="0">…</figure>(与步骤一一对应)
     </div>
   </section>
   第一段和第一帧在 HTML 里就带 .is-active;JS 用 IntersectionObserver 切换 */
.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
}
.story__step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80vh;
  padding-left: 20px;
  border-left: 3px solid #e5e7eb;
  color: #6b7280;
  transition: color .3s ease, border-color .3s ease;
}
.story__step.is-active { color: #111827; border-left-color: #4f46e5; }
.story__stage {
  position: sticky;
  top: 15vh;
  align-self: start;
  height: 70vh;
  overflow: hidden;
  border-radius: 20px;
  background: #f3f4f6;
}
.story__frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.story__frame.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s ease, visibility 0s;
}
@media (max-width: 768px) {
  .story { grid-template-columns: 1fr; gap: 0; }
  .story__stage { top: 0; z-index: 1; grid-row: 1; height: 45vh; }
  .story__step { min-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) {
  .story__step,
  .story__frame,
  .story__frame.is-active { transition: none; }
}

演示 HTML 结构

<div class="s d-story">
  <div class="d-story__left">
    <div class="d-story__step is-on">① 连接数据源<br>两分钟接入你的工具栈</div>
    <div class="d-story__step">② 自动清洗归一<br>脏数据自动变成标准格式</div>
    <div class="d-story__step">③ 生成洞察报告<br>每天早上八点准时送达</div>
  </div>
  <div class="d-story__stage">画面钉在这里<br><span style="font-size:9px;font-weight:500;opacity:.85">右栏 sticky · 左栏滚动推进</span></div>
</div>

无障碍与性能

无障碍

  • 每一帧画面里的关键信息,也要写进对应步骤的文字:没有 JS 时只显示第一帧,读屏用户也只能接触到当前那一帧。
  • 非当前帧在 .4s 淡出结束后切换为 visibility: hidden,会同时从无障碍树中移除,读屏不会把五帧画面一起读出来;只用 opacity: 0 做不到这一点。
  • 当前步骤除了文字变深,还有 3px 的左边框高亮,不只靠颜色区分(SC 1.4.1);未激活步骤用 #6b7280,在白底上仍有约 4.8:1 的对比度,不要为了突出当前步骤把其他步骤淡到看不清。

性能

  • 画面切换只过渡 opacity;visibility 用 0s 加延迟直接切换,不参与插值。
  • 用一个 IntersectionObserver 观察所有步骤,不要在 scroll 事件里逐个计算位置;钉住由 position: sticky 完成,不需要 JS 参与。

常见问题

粘性滚动叙事的英文是什么?

粘性滚动叙事的英文是 Sticky Scroll Storytelling。常见英文别名还包括 Scrollytelling。

Sticky Scroll Storytelling 的中文是什么?

Sticky Scroll Storytelling 的中文是「粘性滚动叙事」。常见中文别名还包括 粘性分步叙事、钉住式叙事。一侧画面钉在屏幕上不动,另一侧文字随滚动逐段推进,讲一个三幕式的故事。

粘性滚动叙事最少需要哪些 JS?

一个 IntersectionObserver:rootMargin: '-50% 0px -49% 0px'、threshold: 0,把观察区域收窄成视口正中一条 1% 高的窄带,哪个步骤压在这条带上,回调里它的 isIntersecting 就是 true;这时给它和 data-step 相同的那一帧加 .is-active,同组其他元素移除。上下各 -50% 的零高度判定线按规范也会触发(边缘相接也算相交),但留出 1% 的窄带不依赖这条边界规则,各浏览器的表现更一致。观察器不需要 unobserve,来回滚动都要切换。

position: sticky 放在 Grid 里为什么不钉住?

Grid 和 Flex 的子项默认 align-self: stretch:画面栏没写固定高度时,会被拉伸到和左侧文字栏一样高,已经没有可以「钉」的空间。给 sticky 的那一栏写明高度(本条 70vh),并加 align-self: start 保持自身高度。祖先需要裁切内容时,用 overflow: clip 代替 overflow: hidden,前者不会创建滚动容器,不影响 sticky。

常见搭配

同一页面里经常和「粘性滚动叙事」一起出现的模式,可以收藏后用「组合收藏为整页提示词」一起交给 AI。

标签