Categories
How to make an up and down button?
Tell me how to make a button up and back to the same place where I flipped through the list! Live example of VKontakte in the feed
Answer the question
In order to leave comments, you need to log in
on the "up" button you save window.pageYOffset and then on the "down" button you do
window.scrollTo({ top: pageYOffset, // сохраненное left: 0, behavior: 'smooth' });
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question