ScrollToOptions.behavior

The behavior property of the ScrollToOptions dictionary specifies whether the scrolling should animate smoothly, or happen instantly in a single jump.

This is actually defined on the ScrollOptions dictionary, which is implemented by ScrollToOptions.

Syntax

behavior: ScrollBehavior

Value

An enum, the value of which can be one of the following:

  • smooth: The scrolling animates smoothly.
  • auto: The scrolling happens in a single jump.

Examples

See ScrollToOptions for an example.

Specifications

Specification
CSSOM View Module (CSSOM View)
# dom-scrolloptions-behavior

Browser compatibility

BCD tables only load in the browser

See also

ScrollToOptions