You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is what I usually do for scrolling to certain positions. You may be able to adjust it to use element.scrollBy() instead of window.scrollTo()
functionscrollTo(position){returnnewPromise(resolve=>{constscrollListener=e=>{if('undefined'===typeofe){return;}consttarget=e.currentTarget;if(target.scrollTop===position){target.removeEventListener('scroll',scrollListener);resolve();}};window.addEventListener('scroll',scrollListener);window.scrollTo({top: position,behavior: 'smooth',});});}scrollTo(element.offsetTop).then(()=>{// Do something});
How is there some callback when i finished my scroll
i have
it is possible add some callback ?? thx
The text was updated successfully, but these errors were encountered: