UNPKG

@ecomplus/storefront-components

Version:
11 lines (10 loc) 184 B
export default ($el, top = 0) => { while ($el.offsetParent) { top += $el.offsetTop $el = $el.offsetParent } return window.scroll({ top, behavior: 'smooth' }) }