How can I prevent the page from “jumping up” each time I click a link? E.g I have a link somewhere in the middle of the page and when I click it the page jumps up to the top.
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.
Let’s presume that this is your HTML for the link:
If you’re using jQuery, try like this:
If you’re not on jQuery drugs, try with this pure DOM JavaScript: