Skip to content

How to Add Smooth Scroll with Custom Easing in WordPress?

Key Takeaways

  • Nexter Blocks Smooth Scroll block adds smooth scrolling with custom easing to a WordPress website, and it requires Nexter Blocks to be installed and activated.
  • Custom easing uses a JavaScript math expression copied from a function’s value after “return”, then replaces the “x” variable with “t” before it is added.
  • Smooth Scroll block uses the Advanced tab’s Easing dropdown set to Custom, and the effect appears on the frontend only.
Table of Contents

Custom easing controls exactly how a scroll glide speeds up and slows down, for a feel that matches your brand.

The free Smooth Scroll block in Nexter Blocks accepts your own easing formula.

For every Smooth Scroll setting in one place, see the Smooth Scroll block guide.

Before You Start

  • Edition: Free — works in Nexter Blocks (free) and with Nexter Blocks Pro.
  • Block to enable: Smooth Scroll, switched on under Nexter > Blocks in your WordPress dashboard.
  • A formula: a short math expression that uses t (from 0 to 1) and returns a value from 0 to 1.

Steps

  1. Open easings.net, pick a curve and scroll to its math function. Copy only the part after return.
  1. Replace every x with t. For example, 1 - Math.pow(1 - x, 4) becomes 1 - Math.pow(1 - t, 4).
  1. Add the Smooth Scroll block, open Scrolling Core and click Advanced.
  1. Set Easing to Custom and paste your formula into Custom.
Easing set to Custom with a formula in the Custom field
  1. Save and scroll the live page to feel the result.

Formula Examples

FeelFormula
Ease out (quadratic)1-(1-t)*(1-t)
Strong ease out1 - Math.pow(1 - t, 4)
Ease in (slow start)t*t*t
Lineart

How It Behaves

  • The formula runs in the browser as JavaScript each time the page scrolls.
  • Duration still sets how long the glide lasts; the formula only shapes the speed over that time.
  • The editor does not show the effect. Check it on the published page.

Limitations

  • The formula must use t. Copied formulas that still use x do not work.
  • A formula with a typo can stop smooth scrolling on the page. Test it after saving.

Troubleshooting

Scrolling is back to normal after adding a formula

Check the formula for typos and that every x is now t, or switch Easing back to a built-in option.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!