I have a website which is one page and the user navigates to each section using links which uses the scrollto jquery plugin.
My problem is: I want to show the active link in the main menu. So if you scroll to the contact form the contact link is highlighted. Now I could do this in jquery by adding the class after clicking. If done like that if a user was to manually scroll to another section the contact link would still be active, which would be incorrect and misleading.
So my thoughts would be to somehow work out which div id is currently in view. I don't really understand how to do that though. Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…