Scroll to top
On this page
When a visitor clicks a link halfway down a page, where should the next page start? Scroll to Top Smoothly decides. It’s on Settings โ AjaxPress โ Animations, under Transition, and it’s free. It’s on by default.
On (the default)
The new page first appears scrolled to the same point as the old one, so there’s no jump. Then it glides smoothly up to the top. It feels continuous, and it shows the visitor that they’re on a new page.
Off
The new page appears at the top straight away, as it would on a normal page load.
Turn it off if the glide feels slow on very long pages, or if you use a page transition and want the animation to be the only movement.
When it doesn’t glide
- Back and Forward. Pages reached with the browser’s Back or Forward buttons never glide.
- The visitor was already at the top. There’s nothing to scroll.
Links to a section of another page
A link such as /pricing/#faq should open the pricing page at its FAQ. With Scroll to Top Smoothly on, and the visitor scrolled down when they click, the new page glides to the top instead of stopping at the section.
If your site links to sections of other pages (a table of contents, “jump to” links in a menu), turn Scroll to Top Smoothly off. The browser then takes visitors straight to the section. Links to a section of the same page always work, because they only scroll.
For developers
Force a value on a site, whatever the setting says, with the ajaxpress_public_settings filter:
add_filter( 'ajaxpress_public_settings', function ( $settings ) {
$settings['scroll_to_top'] = false;
return $settings;
} );