Page JS APIs

Page JS APIs

Scroll the user to an element on the page


// Scroll to an element by providing the direct element or jQuery reference

// Scroll to an element using a selector string

// Scroll the element with a specific context
Fliplet.Page.scrollTo('.title', { context: '[data-entry-id="456"]' })


Param Type Description
target String|Node|jQuery Target element to scroll the user to
options Object (Optional) A map of options for the function
options.duration Number (Optional) Duration of scroll in ms (Default: 200)
options.context String|Node|jQuery (Optional) If set, the scrolling would be performed on the context element instead of the HTML page
options.offset Number (Optional) Additional offset to apply to the scrolling
options.step Function (Optional) A stepping callback function that’s triggered on each step of the scrolling animation


Promise Promise is resolved when the scrolling is completed.

Back to API documentation