Skip to main content

ScrollToController

Purpose​

Enable links to scroll to arbitrary elements using smooth-scroll.

Actions​

ActionPurpose
scrollPerform the scroll

Targets​

TargetPurposeDefault
---

Classes​

ClassPurposeDefault
---

Values​

See scrollIntoView documentation for possible values for behaviour, block, and inline.

Note: If the user's browser does not support smooth scrolling, the browser will ignore these values and scroll using the browser default.

ValueTypeDescriptionDefault
targetStringA CSS selector to the element you wish to scroll to-
behaviourStringOne of auto, smoothauto
blockStringOne of center, end, nearest, startstart
inlineStringOne of center, end, nearest, startnearest

Events​

EventWhenDispatched onevent.detail
----

Side Effects​

None

How to Use​

See Also​

Scroll Container Controller Scroll To Top Controller Scroll To Bottom Controller Scroll Into Focus Controller