Optional
config: ScrollToConfigReadonly
doScrolls the main scrolling element to the element's position.
Readonly
toggleScrolls the main scrolling element to the element's position, if it's not already there, or otherwise scrolls the main scrolling element to the previous saved scroll position.
Readonly
undoScrolls the main scrolling element to the last scroll position before the action was done. If the action had never been done, does nothing.
Scrolls to the given element or to the previous scroll position.
To use with auto-widgets (HTML API) as part of a trigger specification:
offsetX
: A number.offsetY
: A number.scrollable
: A string element specification for an element (see getReferenceElement). Note that, unless it's a DOM ID, the specification is parsed relative to the element being acted on and not the element the trigger is defined on (in case you've used theact-on
trigger option).NOTE: Do not place a + sign in front of the offset values (just omit it if you want a positive offset). Otherwise it will be interpreted as a trigger option.
Example
When the user clicks the button, scroll the main scrolling element to element's position:
Example
When the user clicks the button, scroll the main scrolling element to element's position +10px down:
Example
When the user clicks the button, scroll the main scrolling element to element's position 10px down and 50px left:
Example
When the user clicks the button, scroll the closest parent element with class
scrollable
to the element's position:Example
As above, but using
data-lisn-ref
attribute instead of class selector.