Linked Questions

65 votes
13 answers
166k views

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="#...
M P's user avatar
  • 915
27 votes
6 answers
58k views

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 ...
user avatar
3 votes
4 answers
3k views

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 ...
user avatar
2 votes
1 answer
13k views

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 ...
assensi's user avatar
  • 360
2 votes
7 answers
816 views

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 ...
Anil kumar's user avatar
3 votes
3 answers
318 views

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 ...
user avatar
1 vote
1 answer
432 views

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 ...
nabil libre's user avatar
0 votes
2 answers
77 views

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 ...
sme's user avatar
  • 4,183
0 votes
0 answers
84 views

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 ...
Jeremon's user avatar
  • 81
0 votes
3 answers
43 views

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. ...
elibeli's user avatar