Enum Class ScrollBehavior

java.lang.Object
java.lang.Enum<ScrollBehavior>
com.oorian.css.ScrollBehavior
All Implemented Interfaces:
Serializable, Comparable<ScrollBehavior>, Constable

public enum ScrollBehavior extends Enum<ScrollBehavior>
CSS scroll-behavior property values for controlling scroll animation.

The scroll-behavior property specifies whether scrolling should animate smoothly or jump instantly when triggered by navigation, APIs, or anchor links.

Behavior Values:

  • auto: Instant jump to scroll position (default)
  • smooth: Animate smoothly to scroll position

Usage:


 html.setScrollBehavior(ScrollBehavior.SMOOTH);
 container.setScrollBehavior(ScrollBehavior.AUTO);
 
Since:
2024
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Enum Constant Details

    • AUTO

      public static final ScrollBehavior AUTO
      Scrolling jumps instantly to scroll position (default).
    • SMOOTH

      public static final ScrollBehavior SMOOTH
      Scrolling animates smoothly to scroll position.
    • INITIAL

      public static final ScrollBehavior INITIAL
      Sets to default value.
    • INHERIT

      public static final ScrollBehavior INHERIT
      Inherits from parent element.
    • UNSET

      public static final ScrollBehavior UNSET
      Resets the property to its inherited value or initial value.
    • REVERT

      public static final ScrollBehavior REVERT
      Rolls back to the value defined by a previous cascade origin.
    • REVERT_LAYER

      public static final ScrollBehavior REVERT_LAYER
      Rolls back to the value defined in the previous cascade layer.
  • Method Details

    • values

      public static ScrollBehavior[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ScrollBehavior valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Returns the CSS value string.
      Returns:
      the CSS value
    • toString

      public String toString()
      Returns the CSS value string.
      Overrides:
      toString in class Enum<ScrollBehavior>
      Returns:
      the CSS value