In my card JS <script>
, I’m using the following to scroll centering on an element:
function scrollTo(elm) {
window.scroll({
top: elm.getBoundingClientRect().top + window.scrollY - window.innerHeight/2,
behavior: 'smooth'
});
}
my only gripe is that the smooth scrolling behaviour is ignored. any way to resolve this?