Highlight nav links when scrolling the page
# June 25, 2014 at 3:33 am
I have created a single page web templet where I am trying to hightlight the links depending on the section that I am viewing.
Here is the codepenlink: http://codepen.io/blyk/pen/JGtfd
I dont have any problem with this code by as you notice I have used mouseenter function to identify the divs’ id. It is some sort of hack or my stupidity :/
Actually I was trying to bring the same effect without this stupid hack so I was going throught various stackflow and other blogs to find out the answer but whatever I got has either long code which I cant understand becuase I am noob or used some sort of plugin.
I am using this hack becasue it used very less code but I want to learn real jquery code for this whic can do this using less code . pease help ! :) :)
thanks# June 25, 2014 at 4:25 am
I agree with Paulie_D, I think this is an elegant solution of the problem.
The only challenge would on touch-screen devices or people who read with arrow keys and space-bar.
I would end up checking the position of the
div‘s on every scroll event to see which
divis above the window edge
You must be logged in to reply to this topic.