Linked Questions
10 questions linked to/from smooth scroll to top
65 votes
13 answers
166k views
Scroll smoothly to specific element on page
I want to have 4 buttons/links on the beginning of the page, and under them the content. On the buttons I put this code: <a href="#idElement1">Scroll to element 1</a> <a href="#...
27 votes
6 answers
58k views
How to smoothly scroll to an element in pure JavaScript
I want to smoothly scroll to an element without using jQuery – just pure javascript. I would like a generic function to be able to both scroll down and scroll up smoothly to a specific position in the ...
3 votes
4 answers
3k views
Don't Animate X If Animation X Already Running (inside keyup)
The way it's currently written causes the hide to fire over and over if msg.d starts returning 'false' from 'true' until enough time has passed for the animation to stop. Is there an isHiding or ...
2 votes
1 answer
13k views
How to set a timed transition to the .scrollIntoView behavior: smooth?
This is my code: document.querySelector(#theId).scrollIntoView({ behavior: "smooth", }); I have gone to the documentation of scrollIntoView and I don't seem to find a way to ...
2 votes
7 answers
816 views
Javascript back to top without adding # to the URL
I am a JavaScript rookie. Using a free template code for building a web page. I have a perfectly working back to top snippet but the problem is, it is adding "#" to the URL when i click on ...
3 votes
3 answers
318 views
How to make "scroll to top" JS function go slower in JQuery
How can I edit this code from W3 schools to make it scroll slower by only using JQuery? It currently just jumps to the top. Is there a way to slow it down so the user can see that they are actually ...
1 vote
1 answer
432 views
Is there any alternative to the used method 'scroll top' when a link is clicked?
When a user clicks a link that directs the user to a new page, it generally put the user's view in the middle of the new page, at the same position as the original link. To prevent this, we can use ...
0 votes
2 answers
77 views
JQuery - Smooth scroll within a div
I have a div with a fixed height, and a style property of overflow-y: scroll;. I am needing to know how to use JQuery to scroll to the bottom of this div. All solutions I've found deal with animating ...
0 votes
0 answers
84 views
setTimeout only works when passed a string [duplicate]
So I am trying to implement a smooth scroll function using vanilla javascript. I found a solution here on stack overflow and made it work for my situation. I'm confused because the solution I have now ...
0 votes
3 answers
43 views
Adding smooth animation to scrollTo button function using javascript
Ok I'm new to this please don't judge me I looked around on the net and every video or suggestion seems over complicated as I managed my button to go to the top, I'm just missing the smooth animation. ...