Click here to Skip to main content
15,913,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a nav like:

XML
<ul>
    <li value="sec1"></li>
    <li value="sec2"></li>
    <li value="sec3"></li>
    <li value="sec4"></li>
</ul>

and 4 sections on the page like
HTML
<section id="sec1"></section>
<section id="sec2"></section>
<section id="sec3"></section>
<section id="sec4"></section>

i want to somehow bind sections to menu items so when
user scrolls the page and crosses sections
one by one , respective menu item get hilighted! (using jquery)
Posted
v4

1 solution

I have created a Demo.

Please take a look - [Demo] LI Highlighting on Section Hover.[^].


[Update]
Okay. I found one fiddle for you.

Take a look- http://jsfiddle.net/x3V6Y/[^].

This is exactly what you needed.
 
Share this answer
 
v2
Comments
Moosavi S.M. 26-Sep-13 13:29pm    
i need to clarify my question
i want menu items get highlighted when user scrolls the window
not hovering sections
here's one example that matches my need
http://getbootstrap.com/getting-started/
try scrolling window and pay attention to menu items
Okay. I got it. Let me research about it. I will reply you once I am done.
Moosavi S.M. 28-Sep-13 12:26pm    
let me know when you're done!
Moosavi S.M. 7-Oct-13 2:22am    
if you're not done or ignored it?
Oh I am sorry, I got busy and forgot. I am trying now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900