Can someone help me I'm searching for css/html
code example:
I have a webpage with 3 buttons(top, middle, bottom) each specified to 1 div section on my page, lets say my first div section is in the middle of that page div id='middle'
.
If I click this button(middle) my page would automatically scroll down from the top
of my page to the div #middle
section.
same for the other buttons refered to div id='top'
, and div id='bottom'
Thanks in forward! I really couldnt find any solution on the internet.
Is there a way to keep my buttonlist on a fixed position so it stays on screen while moving through sections?
try this:
For something really basic use this:
Or for something simple in javascript check out this jQuery plugin ScrollTo. Quite useful for scrolling smoothly.
HTML
CSS
Example http://jsfiddle.net/x4wDk/
There is a much easier way to get the smooth scroll effect without javascript. In your CSS just target the entire html tag and give it scroll-behavior: smooth;
The "scroll-behavior" is telling the page how it should scroll and is so much easier than using javascript. Javascript will give you more options on speed and the smoothness but this will deliver without all of the confusing code.