-2

I have a layout like this:

-------- header --------

-- nav --  -- content --
--- 1 ---  -------------
--- 2 ---  -------------
           -------------
           -------------
           - section 1 -
           -------------
           -------------
           -------------
           - section 2 -
           -------------
           -------------
           -------------

-------- footer --------

The nav is sticky, and contains section titles that when clicked auto scroll the user to the respective section.

Also, when the user freely scrolls up and down the page to the different sections, the section titles in the nav highlight (via 'addClass()' jquery method).

In some cases the content has so many sections (and therefore the nav has so many section titles) that the nav requires a scrollbar which means some of the section titles in the nav are hidden.

What I'm looking to achieve is that when the user scrolls to a section whose section title is hidden in the nav, auto scroll inside the nav to the currently active section title to make it visible to the user.

0 Answers