Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Mailchimp 3.1.5 Minor update available for module mailchimp (3.1.5). Release: Commerce Shipping 3.0.5 Minor update available for module commerce_shipping (3.0.5). Release: GoogleTag Manager 2.0.1 Minor update available for module gtm (2.0.1). Usage Milestone: Easy Breadcrumb Module easy_breadcrumb crossed 100,000 active installs. Release: MCP Sentinel 2.17.0 Minor update available for module mcp_sentinel (2.17.0). Release: Commerce ML Exchange 2.0.1 Minor update available for module cmlexchange (2.0.1). Release: Commerce ML Exchange 2.0.0 Major update available for module cmlexchange (2.0.0). Release: SynImport 2.0.0 Major update available for module synimport (2.0.0). Release: Contact ajax 3.0.0 Major update available for module contact_ajax (3.0.0). Module Revived: Contextual Filter from Referer 1.0.2 Module contextual_filter_referer updated after 22 months of inactivity (1.0.2).

Animated scroll to

263 sites Security covered Drupal 9–11
View on drupal.org

This module enables animated scrolling to specific elements on a page, supporting multiple elements in the URL. You can customize scroll speed, pause, correction, and easing globally or per element.

This module creates an animated scroll to elements.

Single and multiple hashes in the URL are allowed. This are some correct URLs:

  • example.com#scrollToMe
  • example.com#scrollToMe#AndToMe
  • example.com#scrollToMe#AndToMe#AlsoToMe

The scroll speed, pause, correction and easing can be set per element (see below).

Default settings can be set on /admin/config/animate-scroll-to/settings

The settings can be overridden per element with the following attributes:

  • data-scroll-speed
  • (value in milliseconds, standard default is 600)

  • data-scroll-pause
  • (value in milliseconds, standard default is 3000)

  • data-scroll-correction
  • (value in pixels, standard default is 0)

  • data-scroll-easing
  • (value as string, standard default is 'swing')

For example:

<p id="scrollToMe" data-scroll-speed="400" data-scroll-pause="8000" data-scroll-correction="150" data-scroll-easing="linear">
Hello world!
</p>
<p id="AndToMe" data-scroll-speed="300" data-scroll-pause="6000" data-scroll-correction="100" data-scroll-easing="swing">
Hello world!
</p>
<p id="AlsoToMe" data-scroll-speed="200" data-scroll-pause="4000" data-scroll-correction="200" data-scroll-easing="linear">
Hello world!
</p>

Since 8.x-1.0-alpha3 states are added to the elements through data attributes:

  • [data-scroll-state="will-become-active"] -> When the element will become active sometime.
  • [data-scroll-state="is-becoming-active"] -> When the page is scrolling to the element.
  • [data-scroll-state="is-active"] -> When the scrolling has been stopped and it is the current element.
  • [data-scroll-state="was-active"] -> When the element was visible earlier while scrolling.

Drupal 9

The module is tested in Drupal 9. If you have trouble using this module in Drupal 9, please create an issue in the issue queue.

Drupal 10

The module is tested in Drupal 10. If you have trouble using this module in Drupal 10, please create an issue in the issue queue.

Drupal 11

The module is tested in Drupal 11. If you have trouble using this module in Drupal 11 please create an issue in the issue queue.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.1 Stable 9–11 Oct 8, 2024