Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This project is not covered by Drupal’s security advisory policy.
Adds CSS class to a HTML element depending on scroll position.
This module adds a format filter:
- Enable ScrollPos-Styler adding (
class="sps"
) to your elements. - Configure the scroll position in px to trigger the style adding (
data-sps-offset="80"
) to your elements. - "sps--abv" or "sps--blw" classes will be added when the window is scrolled above/below the defined position.
Form element example:
$form['container'] = [
'#type' => 'container',
'#attributes' => [
'class' => ['sps'],
'data-sps-offset' => '80',
'#attached' => [
'library' => [
'scrollpos_styler/library',
],
],
],
];
Sponsors
Supporting organizations:
Project information
- Module categories: Developer Tools
- Created by facine on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.