Is there a way of changing a CSS attribute, depending where on the page someone is?
I have menu items that link to anchors on the same page.
I want menu items to highlight (i.e. current) depending which anchor the viewer is nearest.
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.
Yes. Add an onscroll event to body and depending how much user scrolled (you can get scroll position -> document.documentElement.scrollTop) change the css.