On this site I’m using a smooth-scroll function, which works on every link unless you try and go back home. Any suggestions?
On this site I’m using a smooth-scroll function, which works on every link unless
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The id “Home” refers to an fixed positioned element (the header), it’s always visible so the script has no where to scroll to.
Swap Id’s between
<header id="home">and<section id="intro">to<header id="intro">and<section id="home">,or you can just change your first list’s item anchor to<a href="#home">that way the script has somewhere to head to.Remove your section’s padding, and apply it to a more inner element of your sections, otherwise your first section’s headings will be misplaced.
Good Luck Developer!