Scroll always
This commit is contained in:
parent
0c830b3edf
commit
d5f6397faf
|
|
@ -114,13 +114,16 @@ export function FavoriteBar({teams}) {
|
|||
scrollTo.classList.add('scroll-to-highlight');
|
||||
setTimeout(() => {
|
||||
scrollTo.classList.remove('scroll-to-highlight');
|
||||
}, 2000);
|
||||
}, 1005);
|
||||
window.removeEventListener('scroll', handleScroll);
|
||||
}, 100);
|
||||
};
|
||||
|
||||
scrollTo.scrollIntoView({behavior: 'smooth', block: 'center'}); // Smoothly scroll to the target element
|
||||
|
||||
// scroll up a tiny amount to reset the scroll event listener if user is already on the element
|
||||
window.scrollBy(0, 1);
|
||||
|
||||
// Add a scroll event listener to start the highlighting after scrolling only
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue