TransitionsPremium

Slide Over

A solid panel sweeps across the screen from left to right, covers the old page, the new one settles underneath, and it exits on the right: 1 s, the content never moves, only the panel sweeps — and on the way back it runs from right to left. CSS transform + 1.6 KB of JavaScript.

CSSTransformSlide

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Transitions has 52 effects, including 9 free. Explore the category →

3 usage examples

Next slide of a PhD defense — a doctoral school's presentation tool — Slide Over example 1

① Next slide of a PhD defense — a doctoral school's presentation tool

WhenThe PhD candidate clicks "Next" in front of the committee: slide 12 (experimental protocol) gives way to slide 13 (results).
WhyThe sweeping panel marks the change like a page turning, without moving the charts the committee reads until the very last moment.
SettingsPresenter view: 368 × 207 px slide on the left, timer and notes on the right; panel recolored in the school's navy (#1f3a68 to #2f5aa8); CSS bar chart on page B.
Signed quote to purchase order — a plumbing and heating contractor's software — Slide Over example 2

② Signed quote to purchase order — a plumbing and heating contractor's software

WhenThe customer has just signed on the tablet in their kitchen: the boiler replacement quote gives way to the generated supplier purchase order.
WhyThe solid band says "this document is replaced by the next one": you never see a quote/order mix, and the left → right direction follows the order of the file.
SettingsFull-width screen (512 × 244 px), documents on white; the company's orange panel (#e8590c to #f59f00); matching "Create the order" button.
Next step of a recipe sheet — a culinary high school's workshop tablet — Slide Over example 3

③ Next step of a recipe sheet — a culinary high school's workshop tablet

WhenThe apprentice confirms "pastry cream cooled" with an elbow: step 3 and its weights give way to step 4, assembling the strawberry cake.
WhyWith busy hands, the apprentice looks from a distance: a colored band crossing the whole screen is visible from six feet away, far better than text changing in place.
SettingsLarge type (24 px heading, 15 px weights), six-segment progress bar; strawberry-red panel (#c92a2a to #f06595); green full-width 50 px button.

How it works

The .slide-over-overlay panel is the third layer of the .transition-preview screen, set at z-index: 10 over the old page and the new one: a cyan to green gradient as large as the screen, parked off-screen on the left by transform: translateX(-100%), letting clicks through.

On click, the panel gets .animating and plays @keyframes slideOver over 1 s ease-in-out: translateX(-100%) → 0 at 45%, still until 55%, then 100%. It covers the whole screen from 0.45 s to 0.55 s; at 0.5 s the script toggles the .is-b class on .transition-preview, which swaps the pages underneath. The panel animates transform only: no layout recalculation, and the text of A and B stays still, which sets this wipe apart from a slider where the content itself moves. On the next click, the script also sets .is-back, which switches the animation to animation-direction: reverse: the panel enters from the right and leaves on the left (measured 200 ms into the return: +532 px in Chromium 151, +506 px in Firefox 153, so on the right side).

After the sweep, B stays in place: .is-b no longer moves until the next click, which sends the panel the other way to return to A (checked with Chromium, Firefox and WebKit: B holds with no time limit, A comes back on the second click).

Accessibility

  • Reduced motion: the panel no longer sweeps when prefers-reduced-motion: reduce is on; the script sets .is-b on the spot and a 150 ms CSS fade does the swap (measured: no moving panel, B readable within 250 ms).
  • Keyboard and screen readers: the same trigger as Fade Through (fx-0685), a real button that stays focused during the sweep; the hidden page is not read. To announce B on arrival, put aria-live="polite" on the screen.

Browser compatibility

CSS (@keyframes on transform, animation-direction, inset) + 1.6 KB of JavaScript, no dependency. Measured in Chromium 151, Firefox 153 and WebKit 26.5: panel at translateX(0) at swap time, page B held, back to A on the next click with the panel reversed, focus kept, direct swap under reduced motion. inset sets the minimum versions: Chrome 87, Firefox 66, Safari 14.1.

Chrome 87+✓ Full
Firefox 66+✓ Full
Safari 14.1+✓ Full
Edge 87+✓ Full
Mobile iOS 14.5+✓ Full (on tap)
Android Chrome 87+✓ Full (on tap)

Without JavaScript, page A stays on screen and the button does nothing: provide a regular link to the next page. Without inset (Safari before 14.1), write top: 0; right: 0; bottom: 0; left: 0 on .transition-content and .transition-overlay.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="so-stage">
  <div class="transition-preview">
    <div class="transition-content old-content">Page A</div>
    <div class="transition-content new-content">Page B</div>
    <div class="transition-overlay slide-over-overlay"></div>
  </div>
  <button type="button" class="trigger-btn">Trigger Transition</button>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Panel color (CSS — .slide-over-overlay { background }) #0e7490 → #047857 gradient, like page B A brand color turns the wipe into a signature; page B's background color makes it look as if B slides in. Stay opaque: a translucent panel would reveal the swap.
Duration (CSS — animation: … 1s; JS — SWAP_AT, END_AT) 1 s; swap at 500 ms, end at 1,000 ms Change all three together, SWAP_AT at half. Under 0.6 s the panel covers the screen only for an instant: keep the 45% to 55% pause.
Direction (CSS — @keyframes slideOver steps) left to right, back from right to left For a vertical sweep, replace translateX with translateY in the three steps and in the resting rule. .is-back still reverses the direction on the way back.
Pause on the covered screen (CSS — 45% and 55% steps) 0.1 s 40% / 60% keeps the panel centered for 0.2 s, long enough to show a logo or a chapter title on it.
Content (HTML — .old-content, .new-content) "Page A" and "Page B" on two gradients Any HTML. For more than two pages, fill the hidden layer before the click: the panel hides the swap.

FAQ

Slide Transition moves the content itself: the old one leaves to the left while the new one comes in from the right, like a carousel. Slide Over never moves the content: a solid panel sweeps the screen and the swap happens underneath. Choose Slide Transition to flip through items of the same series; Slide Over when the screen must stay readable to the end (a chart, a document) and the change must be visible from afar.
Call stage.querySelector('.trigger-btn').click() from your listener, for instance on keydown for the right arrow: the script handles the animation, the swap and the wait. The button can be visually hidden, but keep it in the page.
Because going back to the previous page naturally reads right to left, like flipping a book backwards. The script sets .is-back when the click starts from page B; the .slide-over-overlay.animating.is-back rule switches the animation to reverse. Remove that rule if you always want the same direction.