Scroll position

Offset default storefront scroll position

Some websites have sticky headers which stay in the same place as user scrolls the page down. When navigating to a new page in Ecwid storefronts, it will scroll to the top of the store page area automatically.

By default, Ecwid can detect the sticky headers and offset the scroll position so that both website header is visible as well as the top area of a store page. However, you can override this value with a custom one. See the example on the right. = || {}; = || {}; = 150;

Important: if store page title is clearly visible or there is little space between the page top and store area – the scroll indent will be disabled.


If you are using a custom scroll position, it will override the scroll_indent described here.

Disable force scrolling to storefront

When Ecwid storefront widget is added to a website, the page will be scrolled to the beginning of storefront by default.

If you want to disable this behaviour, use the config variable. Possible values:

  • "CUSTOM"

Default value: "IMMEDIATELY"

If you need to scroll to a custom position when navigating the Ecwid store, use the "CUSTOM" value and set your custom scrolling function in the configuration. = || Object(); = || Object(); = "DISABLED"; = function() {}; = || Object(); = || Object(); = "CUSTOM"; = function() {
  window.scrollTo(500, 0);


If you use a sticky header on your website, you may want to offset the default storefront scroll position by X amount of pixels. Learn more

Alternative way to disable scrolling to the beginning of storefront is to use the window.history.scrollRestoration config variable with the "auto" value.

window.history.scrollRestoration = 'auto';